From ec606f94dc259cd4d22b11e9147789b87ed73738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 25 Apr 2016 18:55:31 +0200 Subject: [PATCH] Drop NACL platform It's no longer maintained and Chrome-specific, so it's not a viable solution to deploy Godot games in browsers. The current prefered alternative is asm.js (platform/javascript), and we're looking forward to WebAssembly. --- platform/nacl/SCsub | 30 -- platform/nacl/audio_driver_nacl.cpp | 106 ------ platform/nacl/audio_driver_nacl.h | 63 ---- platform/nacl/context_gl_nacl.cpp | 67 ---- platform/nacl/context_gl_nacl.h | 58 --- platform/nacl/detect.py | 71 ---- platform/nacl/geturl_handler.cpp | 150 -------- platform/nacl/geturl_handler.h | 115 ------ platform/nacl/godot_module.cpp | 332 ---------------- platform/nacl/godot_nacl.cpp | 80 ---- platform/nacl/html/check_browser.js | 178 --------- platform/nacl/html/godot_nacl.nmf | 6 - platform/nacl/html/icon_128.png | Bin 11146 -> 0 bytes platform/nacl/html/icon_16.png | Bin 828 -> 0 bytes platform/nacl/html/index.html | 258 ------------- platform/nacl/html/manifest.json | 19 - platform/nacl/logo.png | Bin 2705 -> 0 bytes platform/nacl/nacl_keycodes.h | 422 --------------------- platform/nacl/opengl_context.cpp | 123 ------ platform/nacl/opengl_context.h | 124 ------ platform/nacl/os_nacl.cpp | 566 ---------------------------- platform/nacl/os_nacl.h | 156 -------- platform/nacl/pepper_main.cpp | 541 -------------------------- platform/nacl/platform_config.h | 29 -- 24 files changed, 3494 deletions(-) delete mode 100644 platform/nacl/SCsub delete mode 100644 platform/nacl/audio_driver_nacl.cpp delete mode 100644 platform/nacl/audio_driver_nacl.h delete mode 100644 platform/nacl/context_gl_nacl.cpp delete mode 100644 platform/nacl/context_gl_nacl.h delete mode 100644 platform/nacl/detect.py delete mode 100644 platform/nacl/geturl_handler.cpp delete mode 100644 platform/nacl/geturl_handler.h delete mode 100644 platform/nacl/godot_module.cpp delete mode 100644 platform/nacl/godot_nacl.cpp delete mode 100644 platform/nacl/html/check_browser.js delete mode 100644 platform/nacl/html/godot_nacl.nmf delete mode 100644 platform/nacl/html/icon_128.png delete mode 100644 platform/nacl/html/icon_16.png delete mode 100644 platform/nacl/html/index.html delete mode 100644 platform/nacl/html/manifest.json delete mode 100644 platform/nacl/logo.png delete mode 100644 platform/nacl/nacl_keycodes.h delete mode 100644 platform/nacl/opengl_context.cpp delete mode 100644 platform/nacl/opengl_context.h delete mode 100644 platform/nacl/os_nacl.cpp delete mode 100644 platform/nacl/os_nacl.h delete mode 100644 platform/nacl/pepper_main.cpp delete mode 100644 platform/nacl/platform_config.h diff --git a/platform/nacl/SCsub b/platform/nacl/SCsub deleted file mode 100644 index ac01752dbb..0000000000 --- a/platform/nacl/SCsub +++ /dev/null @@ -1,30 +0,0 @@ -Import('env') - -nacl_lib = [ - - 'os_nacl.cpp', - 'audio_driver_nacl.cpp', - 'godot_nacl.cpp', - #'pepper_main.cpp', - 'opengl_context.cpp', - 'godot_module.cpp', - 'geturl_handler.cpp', -] - -nacl_posix = [ - - '#drivers/unix/thread_posix.cpp', - '#drivers/unix/mutex_posix.cpp', - '#drivers/unix/semaphore_posix.cpp', -] - -posix_lib = [] -for f in nacl_posix: - posix_lib.append(env.Object(f, CPPFLAGS = env['CPPFLAGS']+['-DUNIX_ENABLED'], OBJSUFFIX = '.posix'+env['OBJSUFFIX'])) - -prog = env.Program('#bin/godot_nacl', nacl_lib + posix_lib) - -if (env['nacl_arch'] == 'i686'): - env.Alias("nacl_32", prog) -if (env['nacl_arch'] == 'x86_64'): - env.Alias("nacl_64", prog) diff --git a/platform/nacl/audio_driver_nacl.cpp b/platform/nacl/audio_driver_nacl.cpp deleted file mode 100644 index dac9521487..0000000000 --- a/platform/nacl/audio_driver_nacl.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/*************************************************************************/ -/* audio_driver_nacl.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_driver_nacl.h" - -#include "ppapi/cpp/instance.h" - -extern pp::Instance* godot_instance; - -const char* AudioDriverNacl::get_name() const { - - return "Nacl"; -} - -void AudioDriverNacl::output_callback(void* samples, uint32_t buffer_size, void* data) { - - AudioDriverNacl* ad = (AudioDriverNacl*)data; - int16_t* out = (int16_t*)samples; - - ad->lock(); - ad->audio_server_process(ad->sample_frame_count_, ad->samples_in); - ad->unlock(); - - for (int i=0; isample_count; i++) { - - out[i] = ad->samples_in[i]>>16; - }; - -}; - -Error AudioDriverNacl::init(){ - - int frame_size = 4096; - sample_frame_count_ = pp::AudioConfig::RecommendSampleFrameCount(godot_instance,PP_AUDIOSAMPLERATE_44100, frame_size); - sample_count = sample_frame_count_ * 2; - - audio_ = pp::Audio(godot_instance, - pp::AudioConfig(godot_instance, - PP_AUDIOSAMPLERATE_44100, - sample_frame_count_), - &AudioDriverNacl::output_callback, - this); - - samples_in = memnew_arr(int32_t, sample_frame_count_ * 2); - - return OK; -} -void AudioDriverNacl::start(){ - - audio_.StartPlayback(); -} -int AudioDriverNacl::get_mix_rate() const { - - return 44100; -} -AudioDriverSW::OutputFormat AudioDriverNacl::get_output_format() const{ - - return OUTPUT_STEREO; -} -void AudioDriverNacl::lock(){ - -} -void AudioDriverNacl::unlock() { - - -} -void AudioDriverNacl::finish(){ - - audio_.StopPlayback(); -} - - -AudioDriverNacl::AudioDriverNacl() { -} - -AudioDriverNacl::~AudioDriverNacl() { - - memdelete_arr(samples_in); -} - - diff --git a/platform/nacl/audio_driver_nacl.h b/platform/nacl/audio_driver_nacl.h deleted file mode 100644 index d14e60717a..0000000000 --- a/platform/nacl/audio_driver_nacl.h +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************/ -/* audio_driver_nacl.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_DRIVER_NACL_H -#define AUDIO_DRIVER_NACL_H - -#include "servers/audio/audio_server_sw.h" - -#include "ppapi/cpp/audio.h" - -class AudioDriverNacl : public AudioDriverSW { - - static void output_callback(void* samples, uint32_t buffer_size, void* data); - - int32_t* samples_in; - int sample_frame_count_; - int sample_count; - pp::Audio audio_; - -public: - - virtual const char* get_name() const; - - virtual Error init(); - virtual void start(); - virtual int get_mix_rate() const ; - virtual OutputFormat get_output_format() const; - virtual void lock(); - virtual void unlock(); - virtual void finish(); - - - AudioDriverNacl(); - ~AudioDriverNacl(); -}; - -#endif // AUDIO_DRIVER_NACL_H - diff --git a/platform/nacl/context_gl_nacl.cpp b/platform/nacl/context_gl_nacl.cpp deleted file mode 100644 index ce2f25b69f..0000000000 --- a/platform/nacl/context_gl_nacl.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************/ -/* context_gl_nacl.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 "context_gl_nacl.h" - -#include -#include -#include -#include -#include -#include - -void ContextGLNacl::make_current() { - -}; - -int ContextGLNacl::get_window_width() { - -}; - -int ContextGLNacl::get_window_height() { - -}; - -void ContextGLNacl::swap_buffers() { - -}; - -Error ContextGLNacl::initialize() { - -}; - - -ContextGLNacl::ContextGLNacl() { - - -}; - -ContextGLNacl::~ContextGLNacl() { - -}; - diff --git a/platform/nacl/context_gl_nacl.h b/platform/nacl/context_gl_nacl.h deleted file mode 100644 index 82b9ba0775..0000000000 --- a/platform/nacl/context_gl_nacl.h +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************/ -/* context_gl_nacl.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 CONTEXT_GL_NACL_H -#define CONTEXT_GL_NACL_H - -#include "drivers/gl_context/context_gl.h" - -class NPDevice; - -class ContextGLNacl : public ContextGL { - - enum { - COMMAND_BUFFER_SIZE = 1024 * 1024, - }; - - NPDevice* device3d_; - -public: - - virtual void make_current(); - - virtual int get_window_width(); - virtual int get_window_height(); - virtual void swap_buffers(); - - virtual Error initialize(); - - ContextGLNacl(); - ~ContextGLNacl(); -}; - -#endif // CONTEXT_GL_NACL_H diff --git a/platform/nacl/detect.py b/platform/nacl/detect.py deleted file mode 100644 index eedb29746a..0000000000 --- a/platform/nacl/detect.py +++ /dev/null @@ -1,71 +0,0 @@ -import os -import sys - -def is_active(): - return True - -def get_name(): - return "NaCl" - -def can_build(): - - import os - if not os.environ.has_key("NACLPATH"): - return False - return True - -def get_opts(): - - return [ - ('NACLPATH', 'the path to nacl', os.environ.get("NACLPATH", 0)), - ('nacl_arch', 'The architecture for Nacl build (can be i686 or x86_64', 'i686'), - ] - -def get_flags(): - - return [ - ('nedmalloc', 'no'), - ('tools', 'no'), - ] - - - -def configure(env): - - env.Append(CPPPATH=['#platform/nacl']) - - env['OBJSUFFIX'] = ".nacl.${nacl_arch}.o" - env['LIBSUFFIX'] = ".nacl.${nacl_arch}.a" - env['PROGSUFFIX'] = ".${nacl_arch}.nexe" - - env['ENV']['PATH'] = env['ENV']['PATH']+":"+env['NACLPATH']+"/toolchain/linux_x86_newlib/bin" - - env['CC'] = '${nacl_arch}-nacl-gcc' - env['CXX'] = '${nacl_arch}-nacl-g++' - env['AR'] = '${nacl_arch}-nacl-ar' - - env.Append(CCFLAGS=['-fexceptions', '-Wno-long-long', '-pthread', '-DXP_UNIX']) - - env.Append(CPPPATH=env['NACLPATH']) - - if (env["target"]=="release"): - - env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer', '-ffunction-sections', '-fdata-sections', '-fno-default-inline']) - - elif (env["target"]=="debug"): - - env.Append(CCFLAGS=['-g', '-O0', '-Wall','-DDEBUG_ENABLED']) - - - elif (env["target"]=="profile"): - - env.Append(CCFLAGS=['-g','-pg']) - env.Append(LINKFLAGS=['-pg']) - - env.Append(CCFLAGS=['-DNACL_ENABLED', '-DGLES2_ENABLED']) - - env.Append(LIBFLAGS=['m32']) - env.Append(LIBS=env.Split('ppapi ppapi_cpp pthread srpc ppapi_gles22')) - - import methods - env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) diff --git a/platform/nacl/geturl_handler.cpp b/platform/nacl/geturl_handler.cpp deleted file mode 100644 index 6be82f3f5a..0000000000 --- a/platform/nacl/geturl_handler.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/*************************************************************************/ -/* geturl_handler.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 "geturl_handler.h" - -#include "core/os/copymem.h" - -#include -#include -#include "ppapi/c/pp_errors.h" -#include "ppapi/c/ppb_instance.h" -#include "ppapi/cpp/module.h" -#include "ppapi/cpp/var.h" - -void GetURLHandler::Start() { - pp::CompletionCallback cc = - cc_factory_.NewCallback(&GetURLHandler::OnOpen); - url_loader_.Open(url_request_, cc); -} - -void GetURLHandler::OnOpen(int32_t result) { - if (result != PP_OK) { - status = STATUS_ERROR; - return; - } - // Here you would process the headers. A real program would want to at least - // check the HTTP code and potentially cancel the request. - // pp::URLResponseInfo response = loader_.GetResponseInfo(); - - // Start streaming. - ReadBody(); -} - -void GetURLHandler::AppendDataBytes(const char* buffer, int32_t num_bytes) { - if (num_bytes <= 0) - return; - // Make sure we don't get a buffer overrun. - num_bytes = std::min(READ_BUFFER_SIZE, num_bytes); - int ofs = data.size(); - data.resize(ofs + num_bytes); - copymem(&data[ofs], buffer, num_bytes); -} - -void GetURLHandler::OnRead(int32_t result) { - if (result == PP_OK) { - // Streaming the file is complete. - status = STATUS_COMPLETED; - instance_->HandleMessage("package_finished"); - instance_->HandleMessage(0); - printf("completed!\n"); - } else if (result > 0) { - // The URLLoader just filled "result" number of bytes into our buffer. - // Save them and perform another read. - AppendDataBytes(buffer_, result); - ReadBody(); - } else { - // A read error occurred. - status = STATUS_ERROR; - ERR_FAIL_COND(result < 0); - } -} - -void GetURLHandler::ReadBody() { - // Note that you specifically want an "optional" callback here. This will - // allow ReadBody() to return synchronously, ignoring your completion - // callback, if data is available. For fast connections and large files, - // reading as fast as we can will make a large performance difference - // However, in the case of a synchronous return, we need to be sure to run - // the callback we created since the loader won't do anything with it. - pp::CompletionCallback cc = - cc_factory_.NewOptionalCallback(&GetURLHandler::OnRead); - int32_t result = PP_OK; - do { - result = url_loader_.ReadResponseBody(buffer_, sizeof(buffer_), cc); - // Handle streaming data directly. Note that we *don't* want to call - // OnRead here, since in the case of result > 0 it will schedule - // another call to this function. If the network is very fast, we could - // end up with a deeply recursive stack. - if (result > 0) { - AppendDataBytes(buffer_, result); - } - } while (result > 0); - - if (result != PP_OK_COMPLETIONPENDING) { - // Either we reached the end of the stream (result == PP_OK) or there was - // an error. We want OnRead to get called no matter what to handle - // that case, whether the error is synchronous or asynchronous. If the - // result code *is* COMPLETIONPENDING, our callback will be called - // asynchronously. - cc.Run(result); - } -} - -GetURLHandler::Status GetURLHandler::get_status() const { - - return status; -}; - -Vector GetURLHandler::get_data() const { - - return data; -}; - -int GetURLHandler::get_bytes_read() const { - - return data.size(); -}; - -GetURLHandler::GetURLHandler(pp::Instance* instance, - const String& url) - : instance_(instance), - url_(url), - url_request_(instance), - url_loader_(instance), - cc_factory_(this) { - url_request_.SetURL(std::string(url.utf8().get_data())); - url_request_.SetMethod("GET"); - status = STATUS_NONE; - printf("url handler for url %ls!\n", url.c_str()); -} - -GetURLHandler::~GetURLHandler() { -} - - diff --git a/platform/nacl/geturl_handler.h b/platform/nacl/geturl_handler.h deleted file mode 100644 index c310ed942d..0000000000 --- a/platform/nacl/geturl_handler.h +++ /dev/null @@ -1,115 +0,0 @@ -/*************************************************************************/ -/* geturl_handler.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 EXAMPLES_GETURL_GETURL_HANDLER_H_ -#define EXAMPLES_GETURL_GETURL_HANDLER_H_ - -#include "core/ustring.h" -#include "core/vector.h" -#include "ppapi/cpp/completion_callback.h" -#include "ppapi/cpp/url_loader.h" -#include "ppapi/cpp/url_request_info.h" -#include "ppapi/cpp/instance.h" -#include "ppapi/utility/completion_callback_factory.h" - -#define READ_BUFFER_SIZE 32768 - -// GetURLHandler is used to download data from |url|. When download is -// finished or when an error occurs, it posts a message back to the browser -// with the results encoded in the message as a string and self-destroys. -// -// EXAMPLE USAGE: -// GetURLHandler* handler* = GetURLHandler::Create(instance,url); -// handler->Start(); -// -class GetURLHandler { - -public: - - enum Status { - - STATUS_NONE, - STATUS_IN_PROGRESS, - STATUS_COMPLETED, - STATUS_ERROR, - }; - -private: - - Status status; - - // Callback fo the pp::URLLoader::Open(). - // Called by pp::URLLoader when response headers are received or when an - // error occurs (in response to the call of pp::URLLoader::Open()). - // Look at and - // for more information about pp::URLLoader. - void OnOpen(int32_t result); - - // Callback fo the pp::URLLoader::ReadResponseBody(). - // |result| contains the number of bytes read or an error code. - // Appends data from this->buffer_ to this->url_response_body_. - void OnRead(int32_t result); - - // Reads the response body (asynchronously) into this->buffer_. - // OnRead() will be called when bytes are received or when an error occurs. - void ReadBody(); - - // Append data bytes read from the URL onto the internal buffer. Does - // nothing if |num_bytes| is 0. - void AppendDataBytes(const char* buffer, int32_t num_bytes); - - pp::Instance* instance_; // Weak pointer. - String url_; // URL to be downloaded. - pp::URLRequestInfo url_request_; - pp::URLLoader url_loader_; // URLLoader provides an API to download URLs. - char buffer_[READ_BUFFER_SIZE]; // Temporary buffer for reads. - Vector data; // Contains accumulated downloaded data. - pp::CompletionCallbackFactory cc_factory_; - bool complete; - - GetURLHandler(const GetURLHandler&); - void operator=(const GetURLHandler&); - -public: - // Creates instance of GetURLHandler on the heap. - // GetURLHandler objects shall be created only on the heap (they - // self-destroy when all data is in). - // Initiates page (URL) download. - void Start(); - - Status get_status() const; - Vector get_data() const; - - int get_bytes_read() const; - - GetURLHandler(pp::Instance* instance_, const String& url); - ~GetURLHandler(); -}; - -#endif // EXAMPLES_GETURL_GETURL_HANDLER_H_ - diff --git a/platform/nacl/godot_module.cpp b/platform/nacl/godot_module.cpp deleted file mode 100644 index 5c558f5ece..0000000000 --- a/platform/nacl/godot_module.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/*************************************************************************/ -/* godot_module.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 "opengl_context.h" - -#include -#include -#include -#include - -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/module.h" -#include "ppapi/gles2/gl2ext_ppapi.h" - -#include "ppapi/cpp/rect.h" -#include "ppapi/cpp/size.h" -#include "ppapi/cpp/var.h" -#include "geturl_handler.h" - -#include "core/variant.h" -#include "os_nacl.h" - -extern int nacl_main(int argc, const char** argn, const char** argv); -extern void nacl_cleanup(); - -static String pkg_url; - -pp::Instance* godot_instance = NULL; - -struct StateData { - int arg_count; - Array args; - String method; -}; - -extern OSNacl* os_nacl; - -class GodotInstance : public pp::Instance { - - enum State { - STATE_METHOD, - STATE_PARAM_COUNT, - STATE_PARAMS, - STATE_CALL, - }; - - State state; - StateData* sd; - SharedOpenGLContext opengl_context_; - int width; - int height; - - #define MAX_ARGS 64 - uint32_t init_argc; - char* init_argn[MAX_ARGS]; - char* init_argv[MAX_ARGS]; - - bool package_loaded; - GetURLHandler* package_pending; - -public: - explicit GodotInstance(PP_Instance instance) : pp::Instance(instance) { - printf("GodotInstance!\n"); - state = STATE_METHOD; - RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_KEYBOARD | PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_TOUCH); - sd = NULL; - package_pending = NULL; - package_loaded = false; - godot_instance = this; - } - virtual ~GodotInstance() { - - nacl_cleanup(); - } - - /// Called by the browser to handle the postMessage() call in Javascript. - /// Detects which method is being called from the message contents, and - /// calls the appropriate function. Posts the result back to the browser - /// asynchronously. - /// @param[in] var_message The message posted by the browser. The possible - /// messages are 'fortyTwo' and 'reverseText:Hello World'. Note that - /// the 'reverseText' form contains the string to reverse following a ':' - /// separator. - virtual void HandleMessage(const pp::Var& var_message); - - bool HandleInputEvent(const pp::InputEvent& event); - - bool Init(uint32_t argc, const char* argn[], const char* argv[]) { - - printf("******* init! %i, %p, %p\n", argc, argn, argv); - fflush(stdout); - if (opengl_context_ == NULL) { - opengl_context_.reset(new OpenGLContext(this)); - }; - opengl_context_->InvalidateContext(this); - opengl_context_->ResizeContext(pp::Size(0, 0)); - int current = opengl_context_->MakeContextCurrent(this); - printf("current is %i\n", current); - - os_nacl = new OSNacl; - - pkg_url = ""; - for (uint32_t i=0; iStart(); - }; - return true; - }; - - // Called whenever the in-browser window changes size. - virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip) { - - if (position.size().width() == width && - position.size().height() == height) - return; // Size didn't change, no need to update anything. - - if (opengl_context_ == NULL) { - opengl_context_.reset(new OpenGLContext(this)); - }; - opengl_context_->InvalidateContext(this); - opengl_context_->ResizeContext(position.size()); - if (!opengl_context_->MakeContextCurrent(this)) - return; - - width = position.size().width(); - height = position.size().height(); - // init gl here? - OS::VideoMode vm; - vm.width = width; - vm.height = height; - vm.resizable = false; - vm.fullscreen = true; - OS::get_singleton()->set_video_mode(vm, 0); - - DrawSelf(); - }; - - // Called to draw the contents of the module's browser area. - void DrawSelf() { - - if (opengl_context_ == NULL) - return; - - opengl_context_->FlushContext(); - }; -}; - -static Variant to_variant(const pp::Var& p_var) { - - if (p_var.is_undefined() || p_var.is_null()) - return Variant(); - if (p_var.is_bool()) - return Variant(p_var.AsBool()); - if (p_var.is_double()) - return Variant(p_var.AsDouble()); - if (p_var.is_int()) - return Variant((int64_t)p_var.AsInt()); - if (p_var.is_string()) - return Variant(String::utf8(p_var.AsString().c_str())); - - return Variant(); -}; - -void GodotInstance::HandleMessage(const pp::Var& var_message) { - - switch (state) { - - case STATE_METHOD: { - - ERR_FAIL_COND(!var_message.is_string()); - sd->method = var_message.AsString().c_str(); - state = STATE_PARAM_COUNT; - } break; - case STATE_PARAM_COUNT: { - - ERR_FAIL_COND(!var_message.is_number()); - sd->arg_count = var_message.AsInt(); - state = sd->arg_count>0?STATE_PARAMS:STATE_CALL; - - } break; - case STATE_PARAMS: { - - Variant p = to_variant(var_message); - sd->args.push_back(p); - if (sd->args.size() >= sd->arg_count) - state = STATE_CALL; - } break; - default: - break; - }; - - if (state == STATE_CALL) { - - // call - state = STATE_METHOD; - - - if (sd->method == "package_finished") { - - GetURLHandler::Status status = package_pending->get_status(); - printf("status is %i, %i, %i\n", status, GetURLHandler::STATUS_ERROR, GetURLHandler::STATUS_COMPLETED); - if (status == GetURLHandler::STATUS_ERROR) { - printf("Error fetching package!\n"); - }; - if (status == GetURLHandler::STATUS_COMPLETED) { - - OSNacl* os = (OSNacl*)OS::get_singleton(); - os->add_package(pkg_url, package_pending->get_data()); - }; - memdelete(package_pending); - package_pending = NULL; - - package_loaded = true; - - opengl_context_->MakeContextCurrent(this); - nacl_main(init_argc, (const char**)init_argn, (const char**)init_argv); - for (uint32_t i=0; imethod == "get_package_status") { - - if (package_loaded) { - // post "loaded" - PostMessage("loaded"); - } else if (package_pending == NULL) { - // post "none" - PostMessage("none"); - } else { - // post package_pending->get_bytes_read(); - PostMessage(package_pending->get_bytes_read()); - }; - }; - }; -} - -bool GodotInstance::HandleInputEvent(const pp::InputEvent& event) { - - OSNacl* os = (OSNacl*)OS::get_singleton(); - os->handle_event(event); - return true; -}; - -class GodotModule : public pp::Module { - public: - GodotModule() : pp::Module() {} - virtual ~GodotModule() { - glTerminatePPAPI(); - } - - /// Create and return a GodotInstance object. - /// @param[in] instance a handle to a plug-in instance. - /// @return a newly created GodotInstance. - /// @note The browser is responsible for calling @a delete when done. - virtual pp::Instance* CreateInstance(PP_Instance instance) { - printf("CreateInstance! %x\n", instance); - return new GodotInstance(instance); - } - - /// Called by the browser when the module is first loaded and ready to run. - /// This is called once per module, not once per instance of the module on - /// the page. - virtual bool Init() { - printf("GodotModule::init!\n"); - return glInitializePPAPI(get_browser_interface()); - } -}; - -namespace pp { -/// Factory function called by the browser when the module is first loaded. -/// The browser keeps a singleton of this module. It calls the -/// CreateInstance() method on the object you return to make instances. There -/// is one instance per tag on the page. This is the main binding -/// point for your NaCl module with the browser. -/// @return new GodotModule. -/// @note The browser is responsible for deleting returned @a Module. -Module* CreateModule() { - printf("CreateModule!\n"); - return new GodotModule(); -} -} // namespace pp diff --git a/platform/nacl/godot_nacl.cpp b/platform/nacl/godot_nacl.cpp deleted file mode 100644 index d8447390c1..0000000000 --- a/platform/nacl/godot_nacl.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************/ -/* godot_nacl.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 "os_nacl.h" -#include "main/main.h" - -#include -#include - -OSNacl* os_nacl = NULL; - -int nacl_main(int argc, const char** argn, const char** argv) { - - // os is created in GodotModule::Init for the nacl module - printf("called with %i args, %p, %p\n", argc, argn, argv); - char* nargv[64]; - int nargc = 1; - nargv[0] = (char*)argv[0]; - for (int i=1; i= |minChromeVersion_|. - * @type {integer} - * @private - */ - this.minChromeVersion_ = minChromeVersion; - - /** - * List of Browser plugin objects. - * @type {Ojbect array} - * @private - */ - this.plugins_ = plugins; - - /** - * Application version string from the Browser. - * @type {integer} - * @private - */ - this.appVersion_ = appVersion; - - /** - * Flag used to indicate if the browser has Native Client and is if the - * browser version is recent enough. - * @type {boolean} - * @private - */ - this.isValidBrowser_ = false; - - /** - * Actual major version of Chrome -- found by querying the browser. - * @type {integer} - * @private - */ - this.chromeVersion_ = null; - - /** - * Browser support status. This allows the user to get a detailed status - * rather than using this.browserSupportMessage. - */ - this.browserSupportStatus_ = - browser_version.BrowserChecker.StatusValues.UNKNOWN; -} - -/** - * The values used for BrowserChecker status to indicate success or - * a specific error. - * @enum {id} - */ -browser_version.BrowserChecker.StatusValues = { - UNKNOWN: 0, - NACL_ENABLED: 1, - UNKNOWN_BROWSER: 2, - CHROME_VERSION_TOO_OLD: 3, - NACL_NOT_ENABLED: 4, - NOT_USING_SERVER: 5 -}; - -/** - * Determines if the plugin with name |name| exists in the browser. - * @param {string} name The name of the plugin. - * @param {Object array} plugins The plugins in this browser. - * @return {bool} |true| if the plugin is found. - */ -browser_version.BrowserChecker.prototype.pluginExists = function(name, - plugins) { - for (var index=0; index < plugins.length; index++) { - var plugin = this.plugins_[index]; - var plugin_name = plugin['name']; - // If the plugin is not found, you can use the Javascript console - // to see the names of the plugins that were found when debugging. - if (plugin_name.indexOf(name) != -1) { - return true; - } - } - return false; -} - -/** - * Returns browserSupportStatus_ which indicates if the browser supports - * Native Client. Values are defined as literals in - * browser_version.BrowserChecker.StatusValues. - * @ return {int} Level of NaCl support. - */ -browser_version.BrowserChecker.prototype.getBrowserSupportStatus = function() { - return this.browserSupportStatus_; -} - -/** - * Returns isValidBrowser (true/false) to indicate if the browser supports - * Native Client. - * @ return {bool} If this browser has NativeClient and correct version. - */ -browser_version.BrowserChecker.prototype.getIsValidBrowser = function() { - return this.isValidBrowser_; -} - -/** - * Checks to see if this browser can support Native Client applications. - * For Chrome browsers, checks to see if the "Native Client" plugin is - * enabled. - */ -browser_version.BrowserChecker.prototype.checkBrowser = function() { - var versionPatt = /Chrome\/(\d+)\.(\d+)\.(\d+)\.(\d+)/; - var result = this.appVersion_.match(versionPatt); - - // |result| stores the Chrome version number. - if (!result) { - this.isValidBrowser_ = false; - this.browserSupportStatus_ = - browser_version.BrowserChecker.StatusValues.UNKNOWN_BROWSER; - } else { - this.chromeVersion_ = result[1]; - // We know we have Chrome, check version and/or plugin named Native Client - if (this.chromeVersion_ >= this.minChromeVersion_) { - var found_nacl = this.pluginExists('Native Client', this.plugins_); - if (found_nacl) { - this.isValidBrowser_ = true; - this.browserSupportStatus_ = - browser_version.BrowserChecker.StatusValues.NACL_ENABLED; - } else { - this.isValidBrowser_ = false; - this.browserSupportStatus_ = - browser_version.BrowserChecker.StatusValues.NACL_NOT_ENABLED; - } - } else { - // We are in a version that is less than |minChromeVersion_| - this.isValidBrowser_ = false; - this.browserSupportStatus_ = - browser_version.BrowserChecker.StatusValues.CHROME_VERSION_TOO_OLD; - } - } - var my_protocol = window.location.protocol; - if (my_protocol.indexOf('file') == 0) { - this.isValidBrowser_ = false; - this.browserSupportStatus_ = - browser_version.BrowserChecker.StatusValues.NOT_USING_SERVER; - } -} - diff --git a/platform/nacl/html/godot_nacl.nmf b/platform/nacl/html/godot_nacl.nmf deleted file mode 100644 index eca039ec1e..0000000000 --- a/platform/nacl/html/godot_nacl.nmf +++ /dev/null @@ -1,6 +0,0 @@ -{ - "program": { - "x86-64": {"url": "godot_nacl.x86_64.nexe"}, - "x86-32": {"url": "godot_nacl.i686.nexe"} - } -} diff --git a/platform/nacl/html/icon_128.png b/platform/nacl/html/icon_128.png deleted file mode 100644 index 653669c38dcdd160a34601873d13ada33e0cd3a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11146 zcmeAS@N?(olHy`uVBq!ia0y~yU}ykg4mJh`hQoG=rx_R+*pj^6T^Rm@;DWu&Co?cG za29w(7BevLUI$@DCym(^3=G;@o-U3d6}R5*EuW%#y!QU@pP{ASdxg!_8MqrxbbBzU zD6jrnM$8LL)lHL>RH`+ALaZ~DEM zpO5W-DIe1ob(!k5SWzh{RORfkeGeMv9`vdC%Kv{t*v1YE_X*3~4t8YCvRdAe;IiZA zx7*ME+_B_7U_0A<@l2PlRfWemCX~r7yR}$pde^vvkr>{htU0Oe?q<~9p-F# z&NGc?r`v`D)0uzNygIvWQu}lFjHbmb58h>-2@hrG={RBDApPNt{pLsh`5JN7><8*Y zlj}r7l~?7lykO3osm5X)_R)5>`Q=;tA>n)V{{Q1Coqosa+*(E(P>enr2%5}VUk}LV7c-iCQ z{Lm*tqMrI$+kKOxVwX9uw(#|w?dxbNdewBrzvIf!YHlf}H!)1K=z3(J;cNQB^Fbej zuBnETqfFqpeU~F7Sk~`l5B%%@pISA2uLUXg-ck%nf0fo73w zdqEhdOQzN7zOtEj-x^gv7TRiZK#^sU#FVCrzX}JIa91q6c-}vRf1+LkYnQqH`t4OW zF6#vguscjx`EQ$4**5JrIpG>!r(SJ1+2%C&YvSBE>Bj;|Q_t;~#-TR*)K@Nf;T`e@ zd_g~7Jv*xs`M7P>H;IYU8+hlit-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?PVC0Q2jO-F zr{8Xu|GG4J)o1^^Wzwt*E@ma#d}bD{40sULsy-u2#j`S7%`1a@7?L20|TgN7JsWkYy)V*-26Z#QbgXJ=RCTKY$>`k z!sVao2mc1H;KclOqCV#5?VHy@ND!TqQk|85?$F-H3$xko zZcX)mZq1~|x?D-hqTEo)p8pT?gRY%6pLw43ntiB!z}RYUd`>o~{>chMrMYP@9@T{XXtb^WPov;1%Tfk!(dT#l^Rbu#O!YT}6p3!VS`Nw?p9WlPQJNAIlPt4K*J uYl;-KHi?EVR$6&_PF|y>ajn(AdiKEnut#r=4H+017(8A5T-G@yGywod1J2n1 diff --git a/platform/nacl/html/icon_16.png b/platform/nacl/html/icon_16.png deleted file mode 100644 index 9f6678c28940d6b28a30eda69defa60157911702..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 828 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7*pj^6T^Rm@;DWu&Co?cG za29w(7BevLUI$@DCym(^3=B+nJY5_^EKciAKARmAD$zdw`Pfk;BSGOl%cAHGF?wG!!2& zGhkoQP|@;ulhfg65f5&-TX0@EA}qklQo&qtnNgmpm}_T)_LUb~4>J9BZQVZ0HZA7Z z*T<}WP06b-Cfm&lSfR-~iy>U*g5ZI!T^$MYRwO=9c1fr<=yyGNb;8O-Asy3?42!tr zB8!-W1oHTvW$fex=y$EaLNZ=B^rKdi%$D(g%&AxNH=L&~K88V!;a60Q&2q9*!RLE+#v7l0YkaB@yEv{iXI}1P)z3bkgv?W2`;VRa z*!k((=k7Z{cc0fzKYt~s8o*%{htg?yWHAe`%c#nO#4WnQ}d zap9|NZS0q*@(x(Bv~ibi#?789Q=*gt7fzD?afq?pfBx5#E^imP{#_(}(yQdv%M!+g m9E*gvx?R|JVEKV>^$!$0_4gfW{>{L^z~JfX=d#Wzp$PyEu!c?m diff --git a/platform/nacl/html/index.html b/platform/nacl/html/index.html deleted file mode 100644 index e8be6f69b9..0000000000 --- a/platform/nacl/html/index.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - - Load Progress Example - - - - - - - -

Native Client Load Event Example

- -

Status

-
NO-STATUS
- -
- - - - - - -
- -

Event Log

-
event log?
- - - - diff --git a/platform/nacl/html/manifest.json b/platform/nacl/html/manifest.json deleted file mode 100644 index 6e271507a9..0000000000 --- a/platform/nacl/html/manifest.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "Capsuleman's Castle Adventure", - "description": "Capsuleman's Castle Adventure", - "version": "1", - "app": { - "launch": { - "local_path": "index.html" - } - }, - "icons": { - "16": "icon_16.png", - "128": "icon_128.png" - }, - "permissions": [ - "unlimitedStorage", - "notifications", - "experimental" - ] -} diff --git a/platform/nacl/logo.png b/platform/nacl/logo.png deleted file mode 100644 index aac72c01b26b7152e26d540dabe5c1e00a891b1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2705 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}Ea{HEjtmSN`?>!lvNA9* zFct^7J29*~C-V}dGT9@@mw};5je((|g@NH00|P_D3kHT#0|tgy2@DKYGZ+}e3+C(! zv|(UiU`z6LcVYMsf(!O8pUl9(z**oCS!(vJu)Ze zdgbx@`#a0uJuMI|FBDYm5?k52ZSjdoqUwREt3P$IeQXxK?fc5aQ}Fvz-dzh^6~)JRq1G|MftP5=QXttHiYut zp2+_pvBBE-`~Uyn{tMduoA`a^wRx|7zio^wTfP5t1Czj=lx1u$8bmy@=2yPGnXmf! zHpd!9bB41H))%UNPg}@qZC3JK+_ft)_Cf5t=y~>*l}|ri*}5|_VPl%MgXji%*C&fP zBotU~xu!hmJpayi!}6v7?yY@&yWF(Xtb6MMF_#ZL?s8%gD^iS~i+dmEpS$zRsf`;y zKK3i+iePvoH8EQ40duc|fB5TN7xUjr{Cs!JEq{lA^`eumF^>e!hW`}`v{7bZTYvBR zf}L`iE1&1gk*%*>_~%Zxy8m8ApQ}of_RF96&G3Qg0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2S`FFRqlk?{+ zet1kmdeW4er}D&Ru^sq+#arp+u3y?`m)&0)CtUev%Jc~ltc7!;Wu`y;rfc(soxkwMZ~e*s^OG<4dIkl% z91)+MUU6|x3+sIS+DiNC?_VbA%R7Y@?CdzrYi6usI6-^qiMtLbAIm(yKF#^f@q1HE zHcoJ!rhUXxNr9+!o z@=CgYCpbLcD7HrQ6VD}{O=pzPg@{et%egqjIE*twAxdJl^+mfIpF^@Q97u`^RMuJ< z!73OU5*r$4^I6#LYPop-oqBooO~NXXGu`Fxt$n?_dsD9W_O87x+J9HGd{cUL!1Cy` zMVV82kG!bAd0A6;p- zNPqLk;<5O#8{5`SwEy||uf=W^xAcjx&L4Rq?l?WLG$Q+iv7)!@r7HoQTr1kFOygz# zU)^|lc|%7O%a&yk>y`>%mA}50d*4M7lK?NR6|=7HeR&}I z;fbhCuY>ZDX#q+s-CNnFOK-X&sO}{4Go_O8DO1oP zzYTk-A$NR-YG|)Z3`M7N+cb|6rnq6P}WcF$8tL2T- z*-{_V93M60B$h1<$$xd)+1l)_azmDs_XO6QT>hsAVy8Qb2cBxuRgQ97u^{W{+RAwy zOE&6zdw-3%%@8LYxOL+5xH-Rno7dOAG%(n^t;^nHQl!F6srj=qwM^FKNK4+47IRiE zE%@_9^yU?_1JmxUUZMSPCzn^7)zL`hNU5MsC#^uoO>6j8?|rgmgN*3q=kdDszwhwZ zeN=u>K9Yk75bYjrKgR}$ulb^C_ba_ng;JNqz zH~anz+ZTT?t_!|U{PB(`n{@KOM<4yzW`%iNj`@6MdR9#P>EPbYi+bXD^<@7&JyUP< z`@B1!Rg*Zy|fZMng4 z&T8|WtJ5594Clt!6qS5iTmSp}_4}VD%nT{rckTUuf6n__jk6aACWLM?QLr5{uqFVdQ&MBb@0PXh} A7ytkO diff --git a/platform/nacl/nacl_keycodes.h b/platform/nacl/nacl_keycodes.h deleted file mode 100644 index a0642fc3b7..0000000000 --- a/platform/nacl/nacl_keycodes.h +++ /dev/null @@ -1,422 +0,0 @@ -/*************************************************************************/ -/* nacl_keycodes.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. */ -/*************************************************************************/ - * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com. All rights reserved. - * Copyright (C) 2008, 2009 Google Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#ifndef BASE_KEYBOARD_CODES_POSIX_H_ -#define BASE_KEYBOARD_CODES_POSIX_H_ -#pragma once - -#include "core/os/keyboard.h" - -enum { - VKEY_BACK = 0x08, - VKEY_TAB = 0x09, - VKEY_CLEAR = 0x0C, - VKEY_RETURN = 0x0D, - VKEY_SHIFT = 0x10, - VKEY_CONTROL = 0x11, - VKEY_MENU = 0x12, - VKEY_PAUSE = 0x13, - VKEY_CAPITAL = 0x14, - VKEY_KANA = 0x15, - VKEY_HANGUL = 0x15, - VKEY_JUNJA = 0x17, - VKEY_FINAL = 0x18, - VKEY_HANJA = 0x19, - VKEY_KANJI = 0x19, - VKEY_ESCAPE = 0x1B, - VKEY_CONVERT = 0x1C, - VKEY_NONCONVERT = 0x1D, - VKEY_ACCEPT = 0x1E, - VKEY_MODECHANGE = 0x1F, - VKEY_SPACE = 0x20, - VKEY_PRIOR = 0x21, - VKEY_NEXT = 0x22, - VKEY_END = 0x23, - VKEY_HOME = 0x24, - VKEY_LEFT = 0x25, - VKEY_UP = 0x26, - VKEY_RIGHT = 0x27, - VKEY_DOWN = 0x28, - VKEY_SELECT = 0x29, - VKEY_PRINT = 0x2A, - VKEY_EXECUTE = 0x2B, - VKEY_SNAPSHOT = 0x2C, - VKEY_INSERT = 0x2D, - VKEY_DELETE = 0x2E, - VKEY_HELP = 0x2F, - VKEY_0 = 0x30, - VKEY_1 = 0x31, - VKEY_2 = 0x32, - VKEY_3 = 0x33, - VKEY_4 = 0x34, - VKEY_5 = 0x35, - VKEY_6 = 0x36, - VKEY_7 = 0x37, - VKEY_8 = 0x38, - VKEY_9 = 0x39, - VKEY_A = 0x41, - VKEY_B = 0x42, - VKEY_C = 0x43, - VKEY_D = 0x44, - VKEY_E = 0x45, - VKEY_F = 0x46, - VKEY_G = 0x47, - VKEY_H = 0x48, - VKEY_I = 0x49, - VKEY_J = 0x4A, - VKEY_K = 0x4B, - VKEY_L = 0x4C, - VKEY_M = 0x4D, - VKEY_N = 0x4E, - VKEY_O = 0x4F, - VKEY_P = 0x50, - VKEY_Q = 0x51, - VKEY_R = 0x52, - VKEY_S = 0x53, - VKEY_T = 0x54, - VKEY_U = 0x55, - VKEY_V = 0x56, - VKEY_W = 0x57, - VKEY_X = 0x58, - VKEY_Y = 0x59, - VKEY_Z = 0x5A, - VKEY_LWIN = 0x5B, - VKEY_COMMAND = VKEY_LWIN, // Provide the Mac name for convenience. - VKEY_RWIN = 0x5C, - VKEY_APPS = 0x5D, - VKEY_SLEEP = 0x5F, - VKEY_NUMPAD0 = 0x60, - VKEY_NUMPAD1 = 0x61, - VKEY_NUMPAD2 = 0x62, - VKEY_NUMPAD3 = 0x63, - VKEY_NUMPAD4 = 0x64, - VKEY_NUMPAD5 = 0x65, - VKEY_NUMPAD6 = 0x66, - VKEY_NUMPAD7 = 0x67, - VKEY_NUMPAD8 = 0x68, - VKEY_NUMPAD9 = 0x69, - VKEY_MULTIPLY = 0x6A, - VKEY_ADD = 0x6B, - VKEY_SEPARATOR = 0x6C, - VKEY_SUBTRACT = 0x6D, - VKEY_DECIMAL = 0x6E, - VKEY_DIVIDE = 0x6F, - VKEY_F1 = 0x70, - VKEY_F2 = 0x71, - VKEY_F3 = 0x72, - VKEY_F4 = 0x73, - VKEY_F5 = 0x74, - VKEY_F6 = 0x75, - VKEY_F7 = 0x76, - VKEY_F8 = 0x77, - VKEY_F9 = 0x78, - VKEY_F10 = 0x79, - VKEY_F11 = 0x7A, - VKEY_F12 = 0x7B, - VKEY_F13 = 0x7C, - VKEY_F14 = 0x7D, - VKEY_F15 = 0x7E, - VKEY_F16 = 0x7F, - VKEY_F17 = 0x80, - VKEY_F18 = 0x81, - VKEY_F19 = 0x82, - VKEY_F20 = 0x83, - VKEY_F21 = 0x84, - VKEY_F22 = 0x85, - VKEY_F23 = 0x86, - VKEY_F24 = 0x87, - VKEY_NUMLOCK = 0x90, - VKEY_SCROLL = 0x91, - VKEY_LSHIFT = 0xA0, - VKEY_RSHIFT = 0xA1, - VKEY_LCONTROL = 0xA2, - VKEY_RCONTROL = 0xA3, - VKEY_LMENU = 0xA4, - VKEY_RMENU = 0xA5, - VKEY_BROWSER_BACK = 0xA6, - VKEY_BROWSER_FORWARD = 0xA7, - VKEY_BROWSER_REFRESH = 0xA8, - VKEY_BROWSER_STOP = 0xA9, - VKEY_BROWSER_SEARCH = 0xAA, - VKEY_BROWSER_FAVORITES = 0xAB, - VKEY_BROWSER_HOME = 0xAC, - VKEY_VOLUME_MUTE = 0xAD, - VKEY_VOLUME_DOWN = 0xAE, - VKEY_VOLUME_UP = 0xAF, - VKEY_MEDIA_NEXT_TRACK = 0xB0, - VKEY_MEDIA_PREV_TRACK = 0xB1, - VKEY_MEDIA_STOP = 0xB2, - VKEY_MEDIA_PLAY_PAUSE = 0xB3, - VKEY_MEDIA_LAUNCH_MAIL = 0xB4, - VKEY_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5, - VKEY_MEDIA_LAUNCH_APP1 = 0xB6, - VKEY_MEDIA_LAUNCH_APP2 = 0xB7, - VKEY_OEM_1 = 0xBA, - VKEY_OEM_PLUS = 0xBB, - VKEY_OEM_COMMA = 0xBC, - VKEY_OEM_MINUS = 0xBD, - VKEY_OEM_PERIOD = 0xBE, - VKEY_OEM_2 = 0xBF, - VKEY_OEM_3 = 0xC0, - VKEY_OEM_4 = 0xDB, - VKEY_OEM_5 = 0xDC, - VKEY_OEM_6 = 0xDD, - VKEY_OEM_7 = 0xDE, - VKEY_OEM_8 = 0xDF, - VKEY_OEM_102 = 0xE2, - VKEY_PROCESSKEY = 0xE5, - VKEY_PACKET = 0xE7, - VKEY_ATTN = 0xF6, - VKEY_CRSEL = 0xF7, - VKEY_EXSEL = 0xF8, - VKEY_EREOF = 0xF9, - VKEY_PLAY = 0xFA, - VKEY_ZOOM = 0xFB, - VKEY_NONAME = 0xFC, - VKEY_PA1 = 0xFD, - VKEY_OEM_CLEAR = 0xFE, - VKEY_UNKNOWN = 0 -}; - -static uint32_t godot_key(uint32_t p_key, bool& is_char) { - - is_char = false; - - switch (p_key) { - - case VKEY_BACK: return KEY_BACKSPACE; - case VKEY_TAB: return KEY_TAB; - case VKEY_CLEAR: return KEY_CLEAR; - case VKEY_RETURN: return KEY_RETURN; - case VKEY_SHIFT: return KEY_SHIFT; - case VKEY_CONTROL: return KEY_CONTROL; - case VKEY_MENU: return KEY_MENU; - case VKEY_PAUSE: return KEY_PAUSE; -// case VKEY_CAPITAL: return KEY_CAPITAL; -// case VKEY_KANA: return KEY_KANA; -// case VKEY_HANGUL: return KEY_HANGUL; -// case VKEY_JUNJA: return KEY_JUNJA; -// case VKEY_FINAL: return KEY_FINAL; -// case VKEY_HANJA: return KEY_HANJA; -// case VKEY_KANJI: return KEY_KANJI; - case VKEY_ESCAPE: return KEY_ESCAPE; -// case VKEY_CONVERT: return KEY_CONVERT; -// case VKEY_NONCONVERT: return KEY_NONCONVERT; -// case VKEY_ACCEPT: return KEY_ACCEPT; -// case VKEY_MODECHANGE: return KEY_MODECHANGE; -// case VKEY_PRIOR: return KEY_PRIOR; -// case VKEY_NEXT: return KEY_NEXT; - case VKEY_END: return KEY_END; - case VKEY_HOME: return KEY_HOME; - case VKEY_LEFT: return KEY_LEFT; - case VKEY_UP: return KEY_UP; - case VKEY_RIGHT: return KEY_RIGHT; - case VKEY_DOWN: return KEY_DOWN; -// case VKEY_SELECT: return KEY_SELECT; - case VKEY_PRINT: return KEY_PRINT; -// case VKEY_EXECUTE: return KEY_EXECUTE; -// case VKEY_SNAPSHOT: return KEY_SNAPSHOT; - case VKEY_INSERT: return KEY_INSERT; - case VKEY_DELETE: return KEY_DELETE; - case VKEY_HELP: return KEY_HELP; -// case VKEY_LWIN: return KEY_LWIN; -// case VKEY_RWIN: return KEY_RWIN; -// case VKEY_APPS: return KEY_APPS; -// case VKEY_SLEEP: return KEY_SLEEP; - case VKEY_NUMPAD0: return KEY_KP_0; - case VKEY_NUMPAD1: return KEY_KP_1; - case VKEY_NUMPAD2: return KEY_KP_2; - case VKEY_NUMPAD3: return KEY_KP_3; - case VKEY_NUMPAD4: return KEY_KP_4; - case VKEY_NUMPAD5: return KEY_KP_5; - case VKEY_NUMPAD6: return KEY_KP_6; - case VKEY_NUMPAD7: return KEY_KP_7; - case VKEY_NUMPAD8: return KEY_KP_8; - case VKEY_NUMPAD9: return KEY_KP_9; - case VKEY_MULTIPLY: return KEY_KP_MULTIPLY; - case VKEY_ADD: return KEY_KP_ADD; -// case VKEY_SEPARATOR: return KEY_SEPARATOR; - case VKEY_SUBTRACT: return KEY_KP_SUBTRACT; - case VKEY_DECIMAL: return KEY_KP_PERIOD; - case VKEY_DIVIDE: return KEY_KP_DIVIDE; - case VKEY_F1: return KEY_F1; - case VKEY_F2: return KEY_F2; - case VKEY_F3: return KEY_F3; - case VKEY_F4: return KEY_F4; - case VKEY_F5: return KEY_F5; - case VKEY_F6: return KEY_F6; - case VKEY_F7: return KEY_F7; - case VKEY_F8: return KEY_F8; - case VKEY_F9: return KEY_F9; - case VKEY_F10: return KEY_F10; - case VKEY_F11: return KEY_F11; - case VKEY_F12: return KEY_F12; - case VKEY_F13: return KEY_F13; - case VKEY_F14: return KEY_F14; - case VKEY_F15: return KEY_F15; - case VKEY_F16: return KEY_F16; - /* - case VKEY_F17: return KEY_F17; - case VKEY_F18: return KEY_F18; - case VKEY_F19: return KEY_F19; - case VKEY_F20: return KEY_F20; - case VKEY_F21: return KEY_F21; - case VKEY_F22: return KEY_F22; - case VKEY_F23: return KEY_F23; - case VKEY_F24: return KEY_F24; - */ - case VKEY_NUMLOCK: return KEY_NUMLOCK; - case VKEY_SCROLL: return KEY_SCROLLLOCK; - case VKEY_LSHIFT: return KEY_SHIFT; - case VKEY_RSHIFT: return KEY_SHIFT; - case VKEY_LCONTROL: return KEY_CONTROL; - case VKEY_RCONTROL: return KEY_CONTROL; - case VKEY_LMENU: return KEY_MENU; - case VKEY_RMENU: return KEY_MENU; - case VKEY_BROWSER_BACK: return KEY_BACK; - case VKEY_BROWSER_FORWARD: return KEY_FORWARD; - case VKEY_BROWSER_REFRESH: return KEY_REFRESH; - case VKEY_BROWSER_STOP: return KEY_STOP; - case VKEY_BROWSER_SEARCH: return KEY_SEARCH; - case VKEY_BROWSER_FAVORITES: return KEY_FAVORITES; - case VKEY_BROWSER_HOME: return KEY_HOMEPAGE; - case VKEY_VOLUME_MUTE: return KEY_VOLUMEMUTE; - case VKEY_VOLUME_DOWN: return KEY_VOLUMEDOWN; - case VKEY_VOLUME_UP: return KEY_VOLUMEUP; - case VKEY_MEDIA_NEXT_TRACK: return KEY_MEDIANEXT; - case VKEY_MEDIA_PREV_TRACK: return KEY_MEDIAPREVIOUS; - case VKEY_MEDIA_STOP: return KEY_MEDIASTOP; - case VKEY_MEDIA_PLAY_PAUSE: return KEY_MEDIAPLAY; - case VKEY_MEDIA_LAUNCH_MAIL: return KEY_LAUNCHMAIL; - case VKEY_MEDIA_LAUNCH_MEDIA_SELECT: return KEY_LAUNCHMEDIA; // FUCKING USELESS KEYS, HOW DO THEY WORK? - case VKEY_MEDIA_LAUNCH_APP1: return KEY_LAUNCH0; - case VKEY_MEDIA_LAUNCH_APP2: return KEY_LAUNCH0; -// case VKEY_OEM_102: return KEY_OEM_102; -// case VKEY_PROCESSKEY: return KEY_PROCESSKEY; -// case VKEY_PACKET: return KEY_PACKET; -// case VKEY_ATTN: return KEY_ATTN; -// case VKEY_CRSEL: return KEY_CRSEL; -// case VKEY_EXSEL: return KEY_EXSEL; -// case VKEY_EREOF: return KEY_EREOF; -// case VKEY_PLAY: return KEY_PLAY; -// case VKEY_ZOOM: return KEY_ZOOM; -// case VKEY_NONAME: return KEY_NONAME; -// case VKEY_PA1: return KEY_PA1; -// case VKEY_OEM_CLEAR: return KEY_OEM_CLEAR; - - default: break; - }; - - is_char = true; - - switch (p_key) { - - case VKEY_SPACE: return KEY_SPACE; - case VKEY_0: return KEY_0; - case VKEY_1: return KEY_1; - case VKEY_2: return KEY_2; - case VKEY_3: return KEY_3; - case VKEY_4: return KEY_4; - case VKEY_5: return KEY_5; - case VKEY_6: return KEY_6; - case VKEY_7: return KEY_7; - case VKEY_8: return KEY_8; - case VKEY_9: return KEY_9; - case VKEY_A: return KEY_A; - case VKEY_B: return KEY_B; - case VKEY_C: return KEY_C; - case VKEY_D: return KEY_D; - case VKEY_E: return KEY_E; - case VKEY_F: return KEY_F; - case VKEY_G: return KEY_G; - case VKEY_H: return KEY_H; - case VKEY_I: return KEY_I; - case VKEY_J: return KEY_J; - case VKEY_K: return KEY_K; - case VKEY_L: return KEY_L; - case VKEY_M: return KEY_M; - case VKEY_N: return KEY_N; - case VKEY_O: return KEY_O; - case VKEY_P: return KEY_P; - case VKEY_Q: return KEY_Q; - case VKEY_R: return KEY_R; - case VKEY_S: return KEY_S; - case VKEY_T: return KEY_T; - case VKEY_U: return KEY_U; - case VKEY_V: return KEY_V; - case VKEY_W: return KEY_W; - case VKEY_X: return KEY_X; - case VKEY_Y: return KEY_Y; - case VKEY_Z: return KEY_Z; - /* - case VKEY_OEM_PLUS: return KEY_PLUS; - case VKEY_OEM_COMMA: return KEY_COMMA; - case VKEY_OEM_MINUS: return KEY_MINUS; - case VKEY_OEM_PERIOD: return KEY_PERIOD; - case VKEY_OEM_1: return KEY_OEM_1; - case VKEY_OEM_2: return KEY_OEM_2; - case VKEY_OEM_3: return KEY_OEM_3; - case VKEY_OEM_4: return KEY_OEM_4; - case VKEY_OEM_5: return KEY_OEM_5; - case VKEY_OEM_6: return KEY_OEM_6; - case VKEY_OEM_7: return KEY_OEM_7; - case VKEY_OEM_8: return KEY_OEM_8; - */ - default: break; - - }; - - return 0; -}; - -#endif // BASE_KEYBOARD_CODES_POSIX_H_ diff --git a/platform/nacl/opengl_context.cpp b/platform/nacl/opengl_context.cpp deleted file mode 100644 index ae72e4ddbb..0000000000 --- a/platform/nacl/opengl_context.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/*************************************************************************/ -/* opengl_context.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 "opengl_context.h" - -#include -#include "ppapi/gles2/gl2ext_ppapi.h" -#include "os_nacl.h" -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/module.h" -#include "ppapi/cpp/completion_callback.h" -#include "ppapi/utility/completion_callback_factory.h" - - -namespace { -// This is called by the brower when the 3D context has been flushed to the -// browser window. -void FlushCallback(void* data, int32_t result) { - static_cast(data)->set_flush_pending(false); - static_cast(data)->FlushContext(); -} -} // namespace - -OpenGLContext::OpenGLContext(pp::Instance* p_instance) - : pp::Graphics3DClient(p_instance), - flush_pending_(false) { - - instance = p_instance; - pp::Module* module = pp::Module::Get(); - assert(module); - gles2_interface_ = static_cast( - module->GetBrowserInterface(PPB_OPENGLES2_INTERFACE)); - assert(gles2_interface_); -} - -OpenGLContext::~OpenGLContext() { - glSetCurrentContextPPAPI(0); -} - -bool OpenGLContext::MakeContextCurrent(pp::Instance* instance) { - - if (instance == NULL) { - glSetCurrentContextPPAPI(0); - return false; - } - // Lazily create the Pepper context. - if (context_.is_null()) { - int32_t attribs[] = { - PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8, - PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24, - PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8, - PP_GRAPHICS3DATTRIB_SAMPLES, 0, - PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, 0, - PP_GRAPHICS3DATTRIB_WIDTH, width, - PP_GRAPHICS3DATTRIB_HEIGHT, height, - PP_GRAPHICS3DATTRIB_NONE - }; - - context_ = pp::Graphics3D(instance, pp::Graphics3D(), attribs); - if (context_.is_null()) { - glSetCurrentContextPPAPI(0); - return false; - } - instance->BindGraphics(context_); - } - glSetCurrentContextPPAPI(context_.pp_resource()); - return true; -} - -void OpenGLContext::ResizeContext(const pp::Size& size) { - - width = size.width(); - height = size.height(); - - if (!context_.is_null()) { - context_.ResizeBuffers(size.width(), size.height()); - } -} - - -void OpenGLContext::InvalidateContext(pp::Instance* instance) { - glSetCurrentContextPPAPI(0); -} - -void OpenGLContext::FlushContext() { - if (flush_pending()) { - // A flush is pending so do nothing; just drop this flush on the floor. - return; - } - set_flush_pending(true); - - OSNacl* os = (OSNacl*)OS::get_singleton(); - MakeContextCurrent(instance); - os->iterate(); - - context_.SwapBuffers(pp::CompletionCallback(&FlushCallback, this)); -} - diff --git a/platform/nacl/opengl_context.h b/platform/nacl/opengl_context.h deleted file mode 100644 index f03a4b3e53..0000000000 --- a/platform/nacl/opengl_context.h +++ /dev/null @@ -1,124 +0,0 @@ -/*************************************************************************/ -/* opengl_context.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 EXAMPLES_TUMBLER_OPENGL_CONTEXT_H_ -#define EXAMPLES_TUMBLER_OPENGL_CONTEXT_H_ - -/// -/// @file -/// OpenGLContext manages the OpenGL context in the browser that is associated -/// with a @a pp::Instance instance. -/// - -#include - -#include -#include - -#include "ppapi/c/ppb_opengles2.h" -//#include "ppapi/cpp/dev/context_3d_dev.h" -#include "ppapi/cpp/graphics_3d_client.h" -#include "ppapi/cpp/graphics_3d.h" -//#include "ppapi/cpp/dev/surface_3d_dev.h" -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/size.h" - -// A convenience wrapper for a shared OpenGLContext pointer type. As other -// smart pointer types are needed, add them here. - -#include - -class OpenGLContext; - -typedef std::tr1::shared_ptr SharedOpenGLContext; - -/// OpenGLContext manages an OpenGL rendering context in the browser. -/// -class OpenGLContext : public pp::Graphics3DClient { - public: - explicit OpenGLContext(pp::Instance* instance); - - /// Release all the in-browser resources used by this context, and make this - /// context invalid. - virtual ~OpenGLContext(); - - /// The Graphics3DClient interfcace. - virtual void Graphics3DContextLost() { - assert(!"Unexpectedly lost graphics context"); - } - - /// Make @a this the current 3D context in @a instance. - /// @param instance The instance of the NaCl module that will receive the - /// the current 3D context. - /// @return success. - bool MakeContextCurrent(pp::Instance* instance); - - /// Flush the contents of this context to the browser's 3D device. - void FlushContext(); - - /// Make the underlying 3D device invalid, so that any subsequent rendering - /// commands will have no effect. The next call to MakeContextCurrent() will - /// cause the underlying 3D device to get rebound and start receiving - /// receiving rendering commands again. Use InvalidateContext(), for - /// example, when resizing the context's viewing area. - void InvalidateContext(pp::Instance* instance); - - void ResizeContext(const pp::Size& size); - - /// The OpenGL ES 2.0 interface. - const struct PPB_OpenGLES2_Dev* gles2() const { - return gles2_interface_; - } - - /// The PP_Resource needed to make GLES2 calls through the Pepper interface. - const PP_Resource gl_context() const { - return context_.pp_resource(); - } - - /// Indicate whether a flush is pending. This can only be called from the - /// main thread; it is not thread safe. - bool flush_pending() const { - return flush_pending_; - } - void set_flush_pending(bool flag) { - flush_pending_ = flag; - } - - private: - pp::Graphics3D context_; - bool flush_pending_; - - int width, height; - - pp::Instance* instance; - - const struct PPB_OpenGLES2_Dev* gles2_interface_; -}; - -#endif // EXAMPLES_TUMBLER_OPENGL_CONTEXT_H_ - diff --git a/platform/nacl/os_nacl.cpp b/platform/nacl/os_nacl.cpp deleted file mode 100644 index e2a92ee8c7..0000000000 --- a/platform/nacl/os_nacl.cpp +++ /dev/null @@ -1,566 +0,0 @@ -/*************************************************************************/ -/* os_nacl.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 "os_nacl.h" - -#include "drivers/unix/memory_pool_static_malloc.h" -#include "os/memory_pool_dynamic_static.h" -#include "main/main.h" -#include -#include -#include -#include - -#include "io/file_access_memory.h" -#include "core/io/file_access_pack.h" -#include "scene/io/scene_loader.h" -#include "scene/main/scene_main_loop.h" - -#include "servers/visual/visual_server_raster.h" - -#include "drivers/gles2/rasterizer_gles2.h" -#include "nacl_keycodes.h" - -#include "core/globals.h" -#include "core/input_map.h" - -#include -#include - -#define UNIX_ENABLED -#include "drivers/unix/thread_posix.h" -#include "drivers/unix/semaphore_posix.h" -#include "drivers/unix/mutex_posix.h" - - -int OSNacl::get_video_driver_count() const { - - return 1; -}; -const char * OSNacl::get_video_driver_name(int p_driver) const { - - return "GLES2"; -}; - -OS::VideoMode OSNacl::get_default_video_mode() const { - - return OS::VideoMode(800,600,false); -}; - -int OSNacl::get_audio_driver_count() const { - - return 1; -}; - -const char * OSNacl::get_audio_driver_name(int p_driver) const { - - return "nacl_audio"; -}; - -static MemoryPoolStaticMalloc *mempool_static=NULL; -static MemoryPoolDynamicStatic *mempool_dynamic=NULL; - -void OSNacl::initialize_core() { - - ticks_start=0; - ticks_start=get_ticks_usec(); -}; - -void OSNacl::initialize(const VideoMode& p_desired,int p_video_driver,int p_audio_driver) { - - rasterizer = memnew( RasterizerGLES2 ); - visual_server = memnew( VisualServerRaster(rasterizer) ); - visual_server->init(); - visual_server->cursor_set_visible(false, 0); - - audio_driver = memnew(AudioDriverNacl); - audio_driver->set_singleton(); - audio_driver->init(); - - sample_manager = memnew( SampleManagerMallocSW ); - audio_server = memnew( AudioServerSW(sample_manager) ); - audio_server->set_mixer_params(AudioMixerSW::INTERPOLATION_LINEAR,false); - audio_server->init(); - - spatial_sound_server = memnew( SpatialSoundServerSW ); - spatial_sound_server->init(); - - spatial_sound_2d_server = memnew( SpatialSound2DServerSW ); - spatial_sound_2d_server->init(); - - // - physics_server = memnew( PhysicsServerSW ); - physics_server->init(); - - physics_2d_server = memnew( Physics2DServerSW ); - physics_2d_server->init(); - - input = memnew(InputDefault); -}; - -void OSNacl::set_main_loop( MainLoop * p_main_loop ) { - - main_loop = p_main_loop; - input->set_main_loop(p_main_loop); - main_loop->init(); -}; - -void OSNacl::delete_main_loop() { - - if (main_loop) - memdelete(main_loop); -}; - -void OSNacl::finalize() { - - -}; -void OSNacl::finalize_core() { - - if (mempool_dynamic) - memdelete( mempool_dynamic ); - delete mempool_static; - -}; - -void OSNacl::alert(const String& p_alert,const String& p_title) { - - fprintf(stderr,"ERROR: %s\n",p_alert.utf8().get_data()); -}; - -void OSNacl::vprint(const char* p_format, va_list p_list, bool p_strerr) { - - vprintf(p_format,p_list); - fflush(stdout); -} - - -String OSNacl::get_stdin_string(bool p_block) { - - char buff[1024]; - return fgets(buff,1024,stdin); -}; - -void OSNacl::set_mouse_show(bool p_show) { - -}; - -void OSNacl::set_mouse_grab(bool p_grab) { - -}; - -bool OSNacl::is_mouse_grab_enabled() const { - - return false; -}; - -int OSNacl::get_mouse_button_state() const { - - return mouse_mask; -}; - - -Point2 OSNacl::get_mouse_pos() const { - - return Point2(); -}; - -void OSNacl::set_window_title(const String& p_title) { -}; - -void OSNacl::set_video_mode(const VideoMode& p_video_mode, int p_screen) { - - video_mode = p_video_mode; -}; - -OS::VideoMode OSNacl::get_video_mode(int p_screen) const { - - return video_mode; -}; - -void OSNacl::get_fullscreen_mode_list(List *p_list,int p_screen) const { - -}; - -Error OSNacl::execute(const String& p_path, const List& p_arguments,bool p_blocking, OS::ProcessID *r_child_id, String* r_pipe, int *r_exitcode) { - - return ERR_UNAVAILABLE; -}; - -Error OSNacl::kill(const ProcessID& p_pid) { - - return ERR_UNAVAILABLE; -}; - -bool OSNacl::has_environment(const String& p_var) const { - - return getenv(p_var.utf8().get_data())!=NULL; -}; - -String OSNacl::get_environment(const String& p_var) const { - - if (getenv(p_var.utf8().get_data())) - return getenv(p_var.utf8().get_data()); - return ""; -}; - -String OSNacl::get_name() { - - return "NaCl"; -}; - -MainLoop *OSNacl::get_main_loop() const { - - return main_loop; -}; - -OS::Date OSNacl::get_date(bool utc) const { - - time_t t=time(NULL); - struct tm *lt; - if (utc) - lt=gmtime(&t); - else - lt=localtime(&t); - Date ret; - ret.year=lt->tm_year; - - // Index starting at 1 to match OS_Unix::get_date - // and Windows SYSTEMTIME and tm_mon follows the typical structure - // of 0-11, noted here: http://www.cplusplus.com/reference/ctime/tm/ - ret.month=(Month)(lt->tm_mon+1); - ret.day=lt->tm_mday; - ret.weekday=(Weekday)lt->tm_wday; - ret.dst=lt->tm_isdst; - - return ret; -}; - -OS::Time OSNacl::get_time(bool utc) const { - - time_t t=time(NULL); - struct tm *lt; - if (utc) - lt=gmtime(&t); - else - lt=localtime(&t); - Time ret; - ret.hour=lt->tm_hour; - ret.min=lt->tm_min; - ret.sec=lt->tm_sec; - return ret; -}; - -OS::TimeZoneInfo OS_Unix::get_time_zone_info() const { - time_t t = time(NULL); - struct tm *lt = localtime(&t); - char name[16]; - strftime(name, 16, "%Z", lt); - name[15] = 0; - TimeZoneInfo ret; - ret.name = name; - - char bias_buf[16]; - strftime(bias_buf, 16, "%z", lt); - int bias; - bias_buf[15] = 0; - sscanf(bias_buf, "%d", &bias); - - // convert from ISO 8601 (1 minute=1, 1 hour=100) to minutes - int hour = (int)bias / 100; - int minutes = bias % 100; - if (bias < 0) - ret.bias = hour * 60 - minutes; - else - ret.bias = hour * 60 + minutes; - - return ret; -}; - -void OSNacl::delay_usec(uint32_t p_usec) const { - - //usleep(p_usec); -}; - -uint64_t OSNacl::get_ticks_usec() const { - - struct timeval tv_now; - gettimeofday(&tv_now,NULL); - - uint64_t longtime = (uint64_t)tv_now.tv_usec + (uint64_t)tv_now.tv_sec*1000000L; - longtime-=ticks_start; - - return longtime; -}; - -bool OSNacl::can_draw() const { - - return minimized != true; -}; - -void OSNacl::queue_event(const InputEvent& p_event) { - - ERR_FAIL_INDEX( event_count, MAX_EVENTS ); - - event_queue[event_count++] = p_event; -}; - -void OSNacl::add_package(String p_name, Vector p_data) { - - FileAccessMemory::register_file(p_name, p_data); - FileAccess::make_default(FileAccess::ACCESS_RESOURCES); - FileAccess::make_default(FileAccess::ACCESS_USERDATA); - FileAccess::make_default(FileAccess::ACCESS_FILESYSTEM); - - if (!PackedData::get_singleton()) - memnew(PackedData); - - printf("adding package %ls, %x\n", p_name.c_str(), PackedData::get_singleton()); - PackedData::get_singleton()->set_disabled(true); - PackedData::get_singleton()->add_pack(p_name); - PackedData::get_singleton()->set_disabled(false); - printf("added\n"); -}; - -void OSNacl::set_cursor_shape(CursorShape p_shape) { - - -}; - -String OSNacl::get_resource_dir() const { - - return "."; -}; - -static int mouse_button(int p_nacl_but) { - - switch (p_nacl_but) { - - case PP_INPUTEVENT_MOUSEBUTTON_LEFT: - return BUTTON_LEFT; - case PP_INPUTEVENT_MOUSEBUTTON_MIDDLE: - return BUTTON_MIDDLE; - case PP_INPUTEVENT_MOUSEBUTTON_RIGHT: - return BUTTON_RIGHT; - }; - - return 0; -}; - -static InputModifierState modifier(uint32_t p_mod) { - - InputModifierState mod_mask; - - mod_mask.shift = p_mod & PP_INPUTEVENT_MODIFIER_SHIFTKEY; - mod_mask.alt = p_mod & PP_INPUTEVENT_MODIFIER_ALTKEY; - mod_mask.control = p_mod & PP_INPUTEVENT_MODIFIER_CONTROLKEY; - mod_mask.meta = p_mod & PP_INPUTEVENT_MODIFIER_METAKEY; - - return mod_mask; -}; - - - -void OSNacl::handle_event(const pp::InputEvent& p_event) { - - int type = p_event.GetType(); - switch (type) { - - case PP_INPUTEVENT_TYPE_MOUSEDOWN: - case PP_INPUTEVENT_TYPE_MOUSEUP: - case PP_INPUTEVENT_TYPE_WHEEL: { - - InputEvent event; - event.ID=++event_id; - event.type = InputEvent::MOUSE_BUTTON; - event.device=0; - - pp::MouseInputEvent mevent(p_event); - if (type == PP_INPUTEVENT_TYPE_WHEEL) { - - pp::WheelInputEvent wevent(p_event);; - float ticks = wevent.GetTicks().y(); - if (ticks == 0) - break; // whut? - - event.mouse_button.pressed = true; - event.mouse_button.button_index = ticks > 0 ? BUTTON_WHEEL_UP : BUTTON_WHEEL_DOWN; - event.mouse_button.doubleclick = false; - - } else { - - event.mouse_button.pressed = (type == PP_INPUTEVENT_TYPE_MOUSEDOWN); - event.mouse_button.button_index = mouse_button(mevent.GetButton()); - event.mouse_button.doubleclick = (mevent.GetClickCount() % 2) == 0; - - mouse_mask &= ~(1<< (event.mouse_button.button_index - 1)); - mouse_mask |= (event.mouse_button.pressed << (event.mouse_button.button_index - 1)); - }; - pp::Point pos = mevent.GetPosition(); - event.mouse_button.button_mask = mouse_mask; - event.mouse_button.global_x = pos.x(); - event.mouse_button.x = pos.x(); - event.mouse_button.global_y = pos.y(); - event.mouse_button.y = pos.y(); - event.mouse_button.pointer_index = 0; - event.mouse_button.mod = modifier(p_event.GetModifiers()); - queue_event(event); - - } break; - - case PP_INPUTEVENT_TYPE_MOUSEMOVE: { - - pp::MouseInputEvent mevent(p_event); - pp::Point pos = mevent.GetPosition(); - - InputEvent event; - event.ID=++event_id; - event.type = InputEvent::MOUSE_MOTION; - event.mouse_motion.pointer_index = 0; - event.mouse_motion.global_x = pos.x(); - event.mouse_motion.global_y = pos.y(); - event.mouse_motion.x = pos.x(); - event.mouse_motion.y = pos.y(); - event.mouse_motion.button_mask = mouse_mask; - event.mouse_motion.mod = modifier(p_event.GetModifiers()); - - event.mouse_motion.relative_x = pos.x() - mouse_last_x; - event.mouse_motion.relative_y = pos.y() - mouse_last_y; - mouse_last_x = pos.x(); - mouse_last_y = pos.y(); - - queue_event(event); - - } break; - - case PP_INPUTEVENT_TYPE_RAWKEYDOWN: - case PP_INPUTEVENT_TYPE_KEYDOWN: - case PP_INPUTEVENT_TYPE_KEYUP: { - - pp::KeyboardInputEvent kevent(p_event); - bool is_char; - uint32_t key = godot_key(kevent.GetKeyCode(), is_char); - if (type != PP_INPUTEVENT_TYPE_KEYUP && is_char) { - - last_scancode = key; - break; - }; - - InputEvent event; - event.ID=++event_id; - event.type = InputEvent::KEY; - event.key.pressed = (type != PP_INPUTEVENT_TYPE_KEYUP); - event.key.scancode = key; - event.key.unicode = key; - - event.key.echo = p_event.GetModifiers() & PP_INPUTEVENT_MODIFIER_ISAUTOREPEAT; - event.key.mod = modifier(p_event.GetModifiers()); - queue_event(event); - } break; - - case PP_INPUTEVENT_TYPE_CHAR: { - - pp::KeyboardInputEvent kevent(p_event); - InputEvent event; - event.ID = ++event_id; - event.type = InputEvent::KEY; - event.key.pressed = true; - event.key.scancode = last_scancode; - event.key.unicode = kevent.GetCharacterText().AsString().c_str()[0]; - event.key.mod = modifier(p_event.GetModifiers()); - event.key.echo = p_event.GetModifiers() & PP_INPUTEVENT_MODIFIER_ISAUTOREPEAT; - queue_event(event); - - } break; - - /* - case NPEventType_Minimize: { - - minimized = p_event->u.minimize.value == 1; - - } break; - - - case NPEventType_Focus: { - - if (p_event->u.focus.value == 1) { - main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN); - } else { - main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT); - }; - } break; - - */ - - default: - ; - }; -}; - -bool OSNacl::iterate() { - - if (!main_loop) { - event_count = 0; - return true; - }; - - for (int i=0; iparse_input_event(event_queue[i]); - }; - - event_count = 0; - - return Main::iteration(); -}; - - -OSNacl::OSNacl() { - - main_loop=NULL; - mempool_dynamic = NULL; - mempool_static = NULL; - mouse_last_x = 0; - mouse_last_y = 0; - event_count = 0; - event_id = 0; - mouse_mask = 0; - video_mode = get_default_video_mode(); - last_scancode = 0; - minimized = false; - - ThreadPosix::make_default(); - SemaphorePosix::make_default(); - MutexPosix::make_default(); - mempool_static = new MemoryPoolStaticMalloc; - mempool_dynamic = memnew( MemoryPoolDynamicStatic ); -}; - -OSNacl::~OSNacl() { - -}; diff --git a/platform/nacl/os_nacl.h b/platform/nacl/os_nacl.h deleted file mode 100644 index 689aa07e20..0000000000 --- a/platform/nacl/os_nacl.h +++ /dev/null @@ -1,156 +0,0 @@ -/*************************************************************************/ -/* os_nacl.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 OS_NACL_H -#define OS_NACL_H - -#include "core/os/os.h" - -#include "servers/visual_server.h" -#include "servers/visual/rasterizer.h" -#include "servers/physics/physics_server_sw.h" -#include "servers/spatial_sound/spatial_sound_server_sw.h" -#include "servers/spatial_sound_2d/spatial_sound_2d_server_sw.h" -#include "servers/audio/audio_server_sw.h" -#include "servers/physics_2d/physics_2d_server_sw.h" -#include "audio_driver_nacl.h" -#include "os/input.h" - - -#include - -class OSNacl : OS { - - uint64_t ticks_start; - -protected: - - enum { - MAX_EVENTS = 64, - }; - - MainLoop *main_loop; - - Rasterizer *rasterizer; - VisualServer *visual_server; - PhysicsServer *physics_server; - SpatialSoundServerSW *spatial_sound_server; - - AudioServerSW *audio_server; - SampleManagerMallocSW *sample_manager; - SpatialSound2DServerSW *spatial_sound_2d_server; - Physics2DServer *physics_2d_server; - AudioDriverNacl* audio_driver; - - - // functions used by main to initialize/deintialize the OS - virtual int get_video_driver_count() const; - virtual const char * get_video_driver_name(int p_driver) const; - - virtual VideoMode get_default_video_mode() const; - - virtual int get_audio_driver_count() const; - virtual const char * get_audio_driver_name(int p_driver) const; - - void vprint(const char* p_format, va_list p_list, bool p_stderr); - - virtual void initialize_core(); - virtual void initialize(const VideoMode& p_desired,int p_video_driver,int p_audio_driver); - - virtual void set_main_loop( MainLoop * p_main_loop ); - virtual void delete_main_loop(); - - virtual void finalize(); - virtual void finalize_core(); - - int mouse_last_x, mouse_last_y; - - InputEvent event_queue[MAX_EVENTS]; - int event_count; - void queue_event(const InputEvent& p_event); - - int event_id; - uint32_t mouse_mask; - - uint32_t last_scancode; - - bool minimized; - - VideoMode video_mode; - - InputDefault *input; - -public: - - void add_package(String p_name, Vector p_data); - - void handle_event(const pp::InputEvent& p_event); - - virtual void alert(const String& p_alert,const String& p_title); - virtual String get_stdin_string(bool p_block); - - virtual void set_mouse_show(bool p_show); - virtual void set_mouse_grab(bool p_grab); - virtual bool is_mouse_grab_enabled() const; - virtual Point2 get_mouse_pos() const; - virtual int get_mouse_button_state() const; - virtual void set_window_title(const String& p_title); - - virtual void set_video_mode(const VideoMode& p_video_mode,int p_screen); - virtual VideoMode get_video_mode(int p_screen) const; - virtual void get_fullscreen_mode_list(List *p_list,int p_screen) const; - - virtual Error execute(const String& p_path, const List& p_arguments,bool p_blocking,ProcessID *r_child_id=NULL,String* r_pipe=NULL,int *r_exitcode=NULL); - virtual Error kill(const ProcessID& p_pid); - - virtual bool has_environment(const String& p_var) const; - virtual String get_environment(const String& p_var) const; - - virtual void set_cursor_shape(CursorShape p_shape); - - virtual String get_name(); - - virtual MainLoop *get_main_loop() const; - - virtual Date get_date(bool utc) const; - virtual Time get_time(bool utc) const; - - virtual void delay_usec(uint32_t p_usec) const; - virtual uint64_t get_ticks_usec() const; - - virtual String get_resource_dir() const; - - virtual bool can_draw() const; - - bool iterate(); - - OSNacl(); - ~OSNacl(); -}; - -#endif // OS_NACL_H diff --git a/platform/nacl/pepper_main.cpp b/platform/nacl/pepper_main.cpp deleted file mode 100644 index 6b81776624..0000000000 --- a/platform/nacl/pepper_main.cpp +++ /dev/null @@ -1,541 +0,0 @@ -/*************************************************************************/ -/* pepper_main.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. */ -/*************************************************************************/ - IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. - ("Apple") in consideration of your agreement to the following terms, and - your use, installation, modification or redistribution of this Apple software - constitutes acceptance of these terms. If you do not agree with these terms, - please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and - subject to these terms, Apple grants you a personal, non-exclusive license, - under Apple's copyrights in this original Apple software - (the "Apple Software"), to use, reproduce, modify and redistribute the Apple - Software, with or without modifications, in source and/or binary forms; - provided that if you redistribute the Apple Software in its entirety and - without modifications, you must retain this notice and the following text and - disclaimers in all such redistributions of the Apple Software. Neither the - name, trademarks, service marks or logos of Apple Computer, Inc. may be used - to endorse or promote products derived from the Apple Software without - specific prior written permission from Apple. Except as expressly stated in - this notice, no other rights or licenses, express or implied, are granted by - Apple herein, including but not limited to any patent rights that may be - infringed by your derivative works or by other works in which the Apple - Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION - AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER - THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR - OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include - -#include "os_nacl.h" -#include - -#include -#include -#include -#include - -static NPNetscapeFuncs kBrowserFuncs = { 0 }; -static NPNetscapeFuncs* browser = &kBrowserFuncs; - -static NPDevice* device3d_ = NULL; -static PGLContext pgl_context_; -static NPDeviceContext3D context3d_; -static int width_; -static int height_; - -extern int nacl_main(int argc, char** argn, char** argv); -extern void nacl_cleanup(); - -NPExtensions* extensions = NULL; -static NPP npp_; - -const int32_t kCommandBufferSize = 1024 * 1024; - -// Plugin entry points -extern "C" { - -// Plugin entry points - -// Entrypoints ----------------------------------------------------------------- - -NPError NP_GetEntryPoints(NPPluginFuncs* plugin_funcs) { - plugin_funcs->version = 11; - plugin_funcs->size = sizeof(plugin_funcs); - plugin_funcs->newp = NPP_New; - plugin_funcs->destroy = NPP_Destroy; - plugin_funcs->setwindow = NPP_SetWindow; - plugin_funcs->newstream = NPP_NewStream; - plugin_funcs->destroystream = NPP_DestroyStream; - plugin_funcs->asfile = NPP_StreamAsFile; - plugin_funcs->writeready = NPP_WriteReady; - plugin_funcs->write = (NPP_WriteUPP)NPP_Write; - plugin_funcs->print = NPP_Print; - plugin_funcs->event = NPP_HandleEvent; - plugin_funcs->urlnotify = NPP_URLNotify; - plugin_funcs->getvalue = NPP_GetValue; - plugin_funcs->setvalue = NPP_SetValue; - - return NPERR_NO_ERROR; -} - -NPError NP_Shutdown() { - pglTerminate(); - return NPERR_NO_ERROR; -} - -NPError NP_GetValue(void* instance, NPPVariable variable, void* value); -char* NP_GetMIMEDescription(); - -NPError NP_Initialize(NPNetscapeFuncs* browser_funcs, - NPPluginFuncs* plugin_funcs) { - printf("NPP_Initialize\n"); - memcpy(&kBrowserFuncs, browser_funcs, sizeof(kBrowserFuncs)); - pglInitialize(); - return NP_GetEntryPoints(plugin_funcs); -} - - -} // extern "C" - -void Initialize3D() { - // Initialize a 3D context. - NPDeviceContext3DConfig config; - config.commandBufferSize = kCommandBufferSize; - NPError err = device3d_->initializeContext(npp_, &config, &context3d_); - if (err != NPERR_NO_ERROR) { - printf("Failed to initialize 3D context\n"); - exit(1); - } - - // Create a PGL context. - pgl_context_ = pglCreateContext(npp_, device3d_, &context3d_); - - // Initialize the demo GL state. - //pglMakeCurrent(pgl_context_); - //GLFromCPPInit(); - //pglMakeCurrent(NULL); -} - -NPError NPP_New(NPMIMEType pluginType, - NPP instance, - uint16_t mode, - int16_t argc, char* argn[], char* argv[], - NPSavedData* saved) { - printf("NPP_New\n"); - if (browser->version >= 14) { - - npp_ = instance; - if (!extensions) { - browser->getvalue(npp_, NPNVPepperExtensions, - reinterpret_cast(&extensions)); - // CHECK(extensions); - } - - printf("%s: %i\n", __FUNCTION__, __LINE__); - - device3d_ = extensions->acquireDevice(npp_, NPPepper3DDevice); - if (device3d_ == NULL) { - printf("Failed to acquire 3DDevice\n"); - exit(1); - } - printf("%s: %i\n", __FUNCTION__, __LINE__); - - /* - deviceaudio_ = extensions->acquireDevice(npp_, NPPepperAudioDevice); - if (deviceaudio_ == NULL) { - printf("Failed to acquire AudioDevice\n"); - exit(1); - } - */ - Initialize3D(); - pglMakeCurrent(pgl_context_); - nacl_main(argc, argn, argv); - pglMakeCurrent(NULL); - }; - - return NPERR_NO_ERROR; -} - -NPError NPP_Destroy(NPP instance, NPSavedData** save) { - - nacl_cleanup(); - - return NPERR_NO_ERROR; -} - -void Destroy3D() { - printf("destroy 3d\n"); - // Destroy the PGL context. - pglDestroyContext(pgl_context_); - pgl_context_ = NULL; - - // Destroy the Device3D context. - device3d_->destroyContext(npp_, &context3d_); -} - -static void iteration(void* data) { - - (void)data; - OSNacl* os = (OSNacl*)OS::get_singleton(); - - if (!pglMakeCurrent(pgl_context_) && pglGetError() == PGL_CONTEXT_LOST) { - printf("******* Lost context! :O\n"); - Destroy3D(); - Initialize3D(); - pglMakeCurrent(pgl_context_); - } - - glViewport(0, 0, width_, height_); - - os->iterate(); - - pglSwapBuffers(); - pglMakeCurrent(NULL); - - browser->pluginthreadasynccall(npp_, iteration, NULL); -}; - -NPError NPP_SetWindow(NPP instance, NPWindow* window) { - - width_ = window->width; - height_ = window->height; - - if (!pgl_context_) - Initialize3D(); - - // Schedule the first call to Draw. - OSNacl* os = (OSNacl*)OS::get_singleton(); - OS::VideoMode vm; - vm.width = width_; - vm.height = height_; - vm.resizable = false; - vm.fullscreen = false; - os->set_video_mode(vm); - - browser->pluginthreadasynccall(npp_, iteration, NULL); - - return NPERR_NO_ERROR; -} - -NPError NPP_NewStream(NPP instance, - NPMIMEType type, - NPStream* stream, - NPBool seekable, - uint16_t* stype) { - *stype = NP_ASFILEONLY; - return NPERR_NO_ERROR; -} - -NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason) { - return NPERR_NO_ERROR; -} - -void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname) { -} - -int32_t NPP_Write(NPP instance, - NPStream* stream, - int32_t offset, - int32_t len, - void* buffer) { - return 0; -} - -int32_t NPP_WriteReady(NPP instance, NPStream* stream) { - return 0; -} - -void NPP_Print(NPP instance, NPPrint* platformPrint) { -} - -int16_t NPP_HandleEvent(NPP instance, void* event) { - - OSNacl* os = (OSNacl*)OS::get_singleton(); - os->handle_event(event); - return 1; -} - -void NPP_URLNotify(NPP instance, - const char* url, - NPReason reason, - void* notify_data) { - // PluginObject* obj = static_cast(instance->pdata); -} - -static NPObject* Allocate(NPP npp, NPClass* npclass) { - return new NPObject; -} - -static void Deallocate(NPObject* object) { - delete object; -} - -// Return |true| if |method_name| is a recognized method. -static bool HasMethod(NPObject* obj, NPIdentifier method_name) { - - char *name = NPN_UTF8FromIdentifier(method_name); - bool is_method = false; - if (strcmp((const char *)name, "start_package") == 0) { - is_method = true; - } else if (strcmp((const char*)name, "add_package_chunk") == 0) { - is_method = true; - } else if (strcmp((const char*)name, "end_package") == 0) { - is_method = true; - } else if (strcmp((const char*)name, "start_scene") == 0) { - is_method = true; - } - NPN_MemFree(name); - return is_method; -} - -// I don't know what this is -static bool InvokeDefault(NPObject *obj, const NPVariant *args, - uint32_t argCount, NPVariant *result) { - if (result) { - NULL_TO_NPVARIANT(*result); - } - return true; -} - -static uint8_t* mem = NULL; -static int pkg_size = 0; -static String pkgname; - -static bool variant_is_number(const NPVariant& v) { - - switch (v.type) { - - case NPVariantType_Int32: - case NPVariantType_Double: - return true; - - default: - return false; - } - return false; -}; - -static double variant_as_number(const NPVariant& v) { - - switch (v.type) { - - case NPVariantType_Int32: - return (double)v.value.intValue; - case NPVariantType_Double: - return (double)v.value.doubleValue; - default: - return 0; - } - - return 0; -}; - -// Invoke() is called by the browser to invoke a function object whose name -// is |method_name|. -static bool Invoke(NPObject* obj, - NPIdentifier method_name, - const NPVariant *args, - uint32_t arg_count, - NPVariant *result) { - NULL_TO_NPVARIANT(*result); - char *name = NPN_UTF8FromIdentifier(method_name); - if (name == NULL) - return false; - bool rval = false; - - OSNacl* os = (OSNacl*)OS::get_singleton(); - - if (strcmp(name, "start_package") == 0) { - - printf("arg count is %i\n", arg_count); - for (int i=0; iadd_package(pkgname, mem, pkg_size); - return true; - }; - - - if (strcmp(name, "start_scene") == 0) { -printf("start_scene!\n"); - if (arg_count != 1) { - return false; - }; - - if (args[0].type != NPVariantType_String) return false; -printf("calling with param %s\n", args[0].value.stringValue.UTF8Characters); - - printf("pepper iteration\n"); - if (!pglMakeCurrent(pgl_context_) && pglGetError() == PGL_CONTEXT_LOST) { - printf("******* Lost context! :O\n"); - Destroy3D(); - Initialize3D(); - pglMakeCurrent(pgl_context_); - } - os->start_scene(String::utf8(args[0].value.stringValue.UTF8Characters)); - pglSwapBuffers(); - pglMakeCurrent(NULL); - -printf("returning true\n"); - return true; - }; - - NPN_MemFree(name); - - return rval; -} - - -static NPClass GodotClass = { - NP_CLASS_STRUCT_VERSION, - Allocate, - Deallocate, - NULL, // Invalidate is not implemented - HasMethod, - Invoke, - InvokeDefault, - NULL, // HasProperty is not implemented - NULL, // GetProperty is not implemented - NULL, // SetProperty is not implemented -}; - -static NPObject* npobject = NULL; - -NPError NPP_GetValue(NPP instance, NPPVariable variable, void* value) { - NPError err = NPERR_NO_ERROR; - - switch (variable) { - case NPPVpluginNameString: - *(reinterpret_cast(value)) = "Pepper Test PlugIn"; - break; - case NPPVpluginDescriptionString: - *(reinterpret_cast(value)) = - "Simple Pepper plug-in for manual testing."; - break; - case NPPVpluginNeedsXEmbed: - *(reinterpret_cast(value)) = 1; - break; - case NPPVpluginScriptableNPObject: { - if (npobject == NULL) { - npobject = NPN_CreateObject(instance, &GodotClass); - } else { - NPN_RetainObject(npobject); - }; - void** v = reinterpret_cast(value); - *v = npobject; - } break; - default: - fprintf(stderr, "Unhandled variable to NPP_GetValue\n"); - err = NPERR_GENERIC_ERROR; - break; - } - - return err; -} - -NPError NPP_SetValue(NPP instance, NPNVariable variable, void* value) { - return NPERR_GENERIC_ERROR; -} - -NPError NP_GetValue(void* instance, NPPVariable variable, void* value) { - return NPP_GetValue(reinterpret_cast(instance), variable, value); -} - -char* NP_GetMIMEDescription() { - return const_cast("pepper-application/x-pepper-test-plugin;"); -} diff --git a/platform/nacl/platform_config.h b/platform/nacl/platform_config.h deleted file mode 100644 index 143f16c1fa..0000000000 --- a/platform/nacl/platform_config.h +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************/ -/* platform_config.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. */ -/*************************************************************************/ -#include