Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UWP: Remove platform port, needs to be redone from scratch for 4.x #81416

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions core/input/godotcontrollerdb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ Linux20d6a713,Bensussen Deutsch & Associates Inc.(BDA) NSW Wired controller,a:b1
Linux054c05c4,Sony Computer Entertainment Wireless Controller,a:b0,b:b1,y:b2,x:b3,start:b9,back:b8,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:-a7,dpleft:-a6,dpdown:+a7,dpright:+a6,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Web
Linux18d19400,18d1-9400-Google LLC Stadia Controller rev. A,a:b0,b:b1,y:b3,x:b2,start:b7,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:-a7,dpleft:-a6,dpdown:+a7,dpright:+a6,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,platform:Web
Linux054c0268,054c-0268-Sony PLAYSTATION(R)3 Controller,a:b0,b:b1,y:b2,x:b3,start:b9,guide:b10,back:b8,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:b13,dpleft:b15,dpdown:b14,dpright:b16,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Web

# UWP
__UWP_GAMEPAD__,Xbox Controller,a:b2,b:b3,x:b4,y:b5,start:b0,back:b1,leftstick:b12,rightstick:b13,leftshoulder:b10,rightshoulder:b11,dpup:b6,dpdown:b7,dpleft:b8,dpright:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,platform:UWP,
1 change: 0 additions & 1 deletion core/input/input_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def make_default_controller_mappings(target, source, env):
"Android": "#if defined(__ANDROID__)",
"iOS": "#ifdef IOS_ENABLED",
"Web": "#ifdef WEB_ENABLED",
"UWP": "#ifdef UWP_ENABLED",
}

g.write("const char* DefaultControllerMappings::mappings[] = {\n")
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/DisplayServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
<method name="get_swap_cancel_ok">
<return type="bool" />
<description>
Returns [code]true[/code] if positions of [b]OK[/b] and [b]Cancel[/b] buttons are swapped in dialogs. This is enabled by default on Windows and UWP to follow interface conventions, and be toggled by changing [member ProjectSettings.gui/common/swap_cancel_ok].
Returns [code]true[/code] if positions of [b]OK[/b] and [b]Cancel[/b] buttons are swapped in dialogs. This is enabled by default on Windows to follow interface conventions, and be toggled by changing [member ProjectSettings.gui/common/swap_cancel_ok].
[b]Note:[/b] This doesn't affect native dialogs such as the ones spawned by [method DisplayServer.dialog_show].
</description>
</method>
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/Input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<description>
Returns the acceleration in m/s² of the device's accelerometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
Note this method returns an empty [Vector3] when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer.
[b]Note:[/b] This method only works on iOS, Android, and UWP. On other platforms, it always returns [constant Vector3.ZERO].
[b]Note:[/b] This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_action_raw_strength" qualifiers="const">
Expand Down Expand Up @@ -166,7 +166,7 @@
<return type="Vector3" />
<description>
Returns the magnetic field strength in micro-Tesla for all axes of the device's magnetometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO].
[b]Note:[/b] This method only works on Android, iOS and UWP. On other platforms, it always returns [constant Vector3.ZERO].
[b]Note:[/b] This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_mouse_button_mask" qualifiers="const">
Expand Down
10 changes: 4 additions & 6 deletions doc/classes/OS.xml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
<return type="String" />
<description>
Returns the name of the host OS.
On Windows, this is [code]"Windows"[/code] or [code]"UWP"[/code] if exported on Universal Windows Platform.
On Windows, this is [code]"Windows"[/code].
On macOS, this is [code]"macOS"[/code].
On Linux-based operating systems, this is [code]"Linux"[/code].
On BSD-based operating systems, this is [code]"FreeBSD"[/code], [code]"NetBSD"[/code], [code]"OpenBSD"[/code], or [code]"BSD"[/code] as a fallback.
Expand All @@ -309,7 +309,7 @@
[codeblocks]
[gdscript]
match OS.get_name():
"Windows", "UWP":
"Windows":
print("Windows")
"macOS":
print("macOS")
Expand All @@ -326,7 +326,6 @@
switch (OS.GetName())
{
case "Windows":
case "UWP":
GD.Print("Windows");
break;
case "macOS":
Expand Down Expand Up @@ -370,7 +369,7 @@
<return type="String" />
<description>
Returns the name of the CPU model on the host machine (e.g. "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz").
[b]Note:[/b] This method is only implemented on Windows, macOS, Linux and iOS. On Android, Web and UWP, [method get_processor_name] returns an empty string.
[b]Note:[/b] This method is only implemented on Windows, macOS, Linux and iOS. On Android and Web, [method get_processor_name] returns an empty string.
</description>
</method>
<method name="get_restart_on_exit_arguments" qualifiers="const">
Expand Down Expand Up @@ -450,7 +449,7 @@
<description>
Returns a string that is unique to the device.
[b]Note:[/b] This string may change without notice if the user reinstalls/upgrades their operating system or changes their hardware. This means it should generally not be used to encrypt persistent data as the data saved before an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by [method get_unique_id] for security purposes.
[b]Note:[/b] Returns an empty string on Web and UWP, as this method isn't implemented on those platforms yet.
[b]Note:[/b] Returns an empty string on Web, as this method isn't implemented on this platform yet.
</description>
</method>
<method name="get_user_data_dir" qualifiers="const">
Expand All @@ -473,7 +472,6 @@
For Windows, the major and minor version are returned, as well as the build number. For example, the returned string can look like [code]10.0.9926[/code] for a build of Windows 10, and it can look like [code]6.1.7601[/code] for a build of Windows 7 SP1.
For rolling distributions, such as Arch Linux, an empty string is returned.
For macOS and iOS, the major and minor version are returned, as well as the patch number.
For UWP, the device family version is returned.
For Android, the SDK version and the incremental build number are returned. If it's a custom ROM, it attempts to return its version instead.
[b]Note:[/b] This method is not supported on the web platform. It returns an empty string.
</description>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@
If [code]true[/code], snaps [Control] node vertices to the nearest pixel to ensure they remain crisp even when the camera moves or zooms.
</member>
<member name="gui/common/swap_cancel_ok" type="bool" setter="" getter="">
If [code]true[/code], swaps [b]Cancel[/b] and [b]OK[/b] buttons in dialogs on Windows and UWP to follow interface conventions. [method DisplayServer.get_swap_cancel_ok] can be used to query whether buttons are swapped at run-time.
If [code]true[/code], swaps [b]Cancel[/b] and [b]OK[/b] buttons in dialogs on Windows to follow interface conventions. [method DisplayServer.get_swap_cancel_ok] can be used to query whether buttons are swapped at run-time.
[b]Note:[/b] This doesn't affect native dialogs such as the ones spawned by [method DisplayServer.dialog_show].
</member>
<member name="gui/common/text_edit_undo_stack_max_size" type="int" setter="" getter="" default="1024">
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/rasterizer_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#define _EXT_DEBUG_OUTPUT 0x92E0

#ifndef GLAPIENTRY
#if defined(WINDOWS_ENABLED) && !defined(UWP_ENABLED)
#if defined(WINDOWS_ENABLED)
#define GLAPIENTRY APIENTRY
#else
#define GLAPIENTRY
Expand Down
65 changes: 18 additions & 47 deletions drivers/unix/ip_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,21 @@

#if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED)

#include <string.h>

#ifdef WINDOWS_ENABLED
#include <stdio.h>

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#ifndef UWP_ENABLED

#include <iphlpapi.h>
#endif

#include <stdio.h>

#else // UNIX

#include <netdb.h>

#ifdef ANDROID_ENABLED
// We could drop this file once we up our API level to 24,
// where the NDK's ifaddrs.h supports to needed getifaddrs.
Expand All @@ -55,13 +57,19 @@
#endif
#include <ifaddrs.h>
#endif

#include <arpa/inet.h>
#include <sys/socket.h>

#ifdef __FreeBSD__
#include <netinet/in.h>
#endif
#include <net/if.h> // Order is important on OpenBSD, leave as last
#endif

#include <net/if.h> // Order is important on OpenBSD, leave as last.

#endif // UNIX

#include <string.h>

static IPAddress _sockaddr2ip(struct sockaddr *p_addr) {
IPAddress ip;
Expand Down Expand Up @@ -126,42 +134,6 @@ void IPUnix::_resolve_hostname(List<IPAddress> &r_addresses, const String &p_hos

#if defined(WINDOWS_ENABLED)

#if defined(UWP_ENABLED)

void IPUnix::get_local_interfaces(HashMap<String, Interface_Info> *r_interfaces) const {
using namespace Windows::Networking;
using namespace Windows::Networking::Connectivity;

// Returns addresses, not interfaces.
auto hostnames = NetworkInformation::GetHostNames();

for (int i = 0; i < hostnames->Size; i++) {
auto hostname = hostnames->GetAt(i);

if (hostname->Type != HostNameType::Ipv4 && hostname->Type != HostNameType::Ipv6) {
continue;
}

String name = hostname->RawName->Data();
HashMap<String, Interface_Info>::Element *E = r_interfaces->find(name);
if (!E) {
Interface_Info info;
info.name = name;
info.name_friendly = hostname->DisplayName->Data();
info.index = String::num_uint64(0);
E = r_interfaces->insert(name, info);
ERR_CONTINUE(!E);
}

Interface_Info &info = E->get();

IPAddress ip = IPAddress(hostname->CanonicalName->Data());
info.ip_addresses.push_front(ip);
}
}

#else

void IPUnix::get_local_interfaces(HashMap<String, Interface_Info> *r_interfaces) const {
ULONG buf_size = 1024;
IP_ADAPTER_ADDRESSES *addrs;
Expand Down Expand Up @@ -208,8 +180,6 @@ void IPUnix::get_local_interfaces(HashMap<String, Interface_Info> *r_interfaces)
memfree(addrs);
}

#endif

#else // UNIX

void IPUnix::get_local_interfaces(HashMap<String, Interface_Info> *r_interfaces) const {
Expand Down Expand Up @@ -248,7 +218,8 @@ void IPUnix::get_local_interfaces(HashMap<String, Interface_Info> *r_interfaces)
freeifaddrs(ifAddrStruct);
}
}
#endif

#endif // UNIX

void IPUnix::make_default() {
_create = _create_unix;
Expand All @@ -261,4 +232,4 @@ IP *IPUnix::_create_unix() {
IPUnix::IPUnix() {
}

#endif
#endif // UNIX_ENABLED || WINDOWS_ENABLED
26 changes: 3 additions & 23 deletions drivers/windows/dir_access_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,10 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

/*

[03:57] <reduz> yessopie, so i don't havemak to rely on unicows
[03:58] <yessopie> reduz- yeah, all of the functions fail, and then you can call GetLastError () which will return 120
[03:58] <drumstick> CategoryApl, hehe, what? :)
[03:59] <CategoryApl> didn't Verona lead to some trouble
[03:59] <yessopie> 120 = ERROR_CALL_NOT_IMPLEMENTED
[03:59] <yessopie> (you can use that constant if you include winerr.h)
[03:59] <CategoryApl> well answer with winning a compo

[04:02] <yessopie> if ( SetCurrentDirectoryW ( L"." ) == FALSE && GetLastError () == ERROR_CALL_NOT_IMPLEMENTED ) { use ANSI }
*/

struct DirAccessWindowsPrivate {
HANDLE h; //handle for findfirstfile
HANDLE h; // handle for FindFirstFile.
WIN32_FIND_DATA f;
WIN32_FIND_DATAW fu; //unicode version
WIN32_FIND_DATAW fu; // Unicode version.
};

String DirAccessWindows::fix_path(String p_path) const {
Expand Down Expand Up @@ -358,12 +345,6 @@ DirAccessWindows::DirAccessWindows() {
p->h = INVALID_HANDLE_VALUE;
current_dir = ".";

#ifdef UWP_ENABLED
Windows::Storage::StorageFolder ^ install_folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
change_dir(install_folder->Path->Data());

#else

DWORD mask = GetLogicalDrives();

for (int i = 0; i < MAX_DRIVES; i++) {
Expand All @@ -375,7 +356,6 @@ DirAccessWindows::DirAccessWindows() {
}

change_dir(".");
#endif
}

DirAccessWindows::~DirAccessWindows() {
Expand All @@ -384,4 +364,4 @@ DirAccessWindows::~DirAccessWindows() {
memdelete(p);
}

#endif //windows DirAccess support
#endif // WINDOWS_ENABLED
1 change: 0 additions & 1 deletion editor/editor_property_name_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ EditorPropertyNameProcessor::EditorPropertyNameProcessor() {
capitalize_string_remaps["uv"] = "UV";
capitalize_string_remaps["uv1"] = "UV1";
capitalize_string_remaps["uv2"] = "UV2";
capitalize_string_remaps["uwp"] = "UWP";
capitalize_string_remaps["vector2"] = "Vector2";
capitalize_string_remaps["vpn"] = "VPN";
capitalize_string_remaps["vram"] = "VRAM";
Expand Down
2 changes: 1 addition & 1 deletion editor/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ void FileSystemDock::_rename_operation_confirm() {

// Present a more user friendly warning for name conflict.
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
#if defined(WINDOWS_ENABLED) || defined(UWP_ENABLED)
#if defined(WINDOWS_ENABLED)
// Workaround case insensitivity on Windows.
if ((da->file_exists(new_path) || da->dir_exists(new_path)) && new_path.to_lower() != old_path.to_lower()) {
#else
Expand Down
3 changes: 1 addition & 2 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,7 @@ int Main::test_entrypoint(int argc, char *argv[], bool &tests_need_run) {
* responsible for the initialization of all low level singletons and core types, and parsing
* command line arguments to configure things accordingly.
* If p_second_phase is true, it will chain into setup2() (default behavior). This is
* disabled on some platforms (Android, iOS, UWP) which trigger the second step in their
* own time.
* disabled on some platforms (Android, iOS) which trigger the second step in their own time.
*
* - setup2(p_main_tid_override) registers high level servers and singletons, displays the
* boot splash, then registers higher level types (scene, editor, etc.).
Expand Down
32 changes: 0 additions & 32 deletions misc/dist/uwp_template/AppxManifest.xml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed misc/dist/uwp_template/Assets/StoreLogo.scale-100.png
Binary file not shown.
Binary file not shown.
6 changes: 0 additions & 6 deletions modules/freetype/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ if env["builtin_freetype"]:
if env["brotli"]:
env_freetype.Append(CPPDEFINES=["FT_CONFIG_OPTION_USE_BROTLI"])

if env["platform"] == "uwp":
# Include header for UWP to fix build issues
env_freetype.Append(CCFLAGS=["/FI", '"modules/freetype/uwpdef.h"'])
# Globally too, as freetype is used in scene (see bottom)
env.Append(CCFLAGS=["/FI", '"modules/freetype/uwpdef.h"'])

env_freetype.Prepend(CPPPATH=[thirdparty_dir + "/include"])
# Also needed in main env for scene/
env.Prepend(CPPPATH=[thirdparty_dir + "/include"])
Expand Down
38 changes: 0 additions & 38 deletions modules/freetype/uwpdef.h

This file was deleted.

Loading