diff options
Diffstat (limited to 'platform/haiku')
| -rw-r--r-- | platform/haiku/audio_driver_media_kit.cpp | 4 | ||||
| -rw-r--r-- | platform/haiku/context_gl_haiku.h | 22 | ||||
| -rw-r--r-- | platform/haiku/detect.py | 6 | ||||
| -rw-r--r-- | platform/haiku/os_haiku.cpp | 10 | ||||
| -rw-r--r-- | platform/haiku/os_haiku.h | 5 | 
5 files changed, 28 insertions, 19 deletions
diff --git a/platform/haiku/audio_driver_media_kit.cpp b/platform/haiku/audio_driver_media_kit.cpp index 8b7dd08bb7..3c4e31da36 100644 --- a/platform/haiku/audio_driver_media_kit.cpp +++ b/platform/haiku/audio_driver_media_kit.cpp @@ -39,11 +39,11 @@ int32_t *AudioDriverMediaKit::samples_in = NULL;  Error AudioDriverMediaKit::init() {  	active = false; -	mix_rate = 44100; +	mix_rate = GLOBAL_DEF_RST("audio/mix_rate", DEFAULT_MIX_RATE);  	speaker_mode = SPEAKER_MODE_STEREO;  	channels = 2; -	int latency = GLOBAL_DEF_RST("audio/output_latency", 25); +	int latency = GLOBAL_DEF_RST("audio/output_latency", DEFAULT_OUTPUT_LATENCY);  	buffer_size = next_power_of_2(latency * mix_rate / 1000);  	samples_in = memnew_arr(int32_t, buffer_size * channels); diff --git a/platform/haiku/context_gl_haiku.h b/platform/haiku/context_gl_haiku.h index 6eb67fea70..8452f5fbfb 100644 --- a/platform/haiku/context_gl_haiku.h +++ b/platform/haiku/context_gl_haiku.h @@ -33,12 +33,10 @@  #if defined(OPENGL_ENABLED) -#include "drivers/gl_context/context_gl.h" -  #include "haiku_direct_window.h"  #include "haiku_gl_view.h" -class ContextGL_Haiku : public ContextGL { +class ContextGL_Haiku {  private:  	HaikuGLView *view;  	HaikuDirectWindow *window; @@ -46,18 +44,18 @@ private:  	bool use_vsync;  public: -	virtual Error initialize(); -	virtual void release_current(); -	virtual void make_current(); -	virtual void swap_buffers(); -	virtual int get_window_width(); -	virtual int get_window_height(); +	Error initialize(); +	void release_current(); +	void make_current(); +	void swap_buffers(); +	int get_window_width(); +	int get_window_height(); -	virtual void set_use_vsync(bool p_use); -	virtual bool is_using_vsync() const; +	void set_use_vsync(bool p_use); +	bool is_using_vsync() const;  	ContextGL_Haiku(HaikuDirectWindow *p_window); -	virtual ~ContextGL_Haiku(); +	~ContextGL_Haiku();  };  #endif diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py index ae8cc58a4a..f33c77a407 100644 --- a/platform/haiku/detect.py +++ b/platform/haiku/detect.py @@ -137,7 +137,7 @@ def configure(env):      if not env['builtin_miniupnpc']:          # No pkgconfig file so far, hardcode default paths. -        env.Append(CPPPATH=["/system/develop/headers/x86/miniupnpc"]) +        env.Prepend(CPPPATH=["/system/develop/headers/x86/miniupnpc"])          env.Append(LIBS=["miniupnpc"])      # On Linux wchar_t should be 32-bits @@ -147,9 +147,9 @@ def configure(env):      ## Flags -    env.Append(CPPPATH=['#platform/haiku']) +    env.Prepend(CPPPATH=['#platform/haiku'])      env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED'])      env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED']) -    # env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) +    # env.Append(CPPFLAGS=['-DFREETYPE_ENABLED'])      env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME'])  # TODO: enable when we have pthread_setname_np      env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL']) diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index a6d5a00852..9c07535c85 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -69,7 +69,7 @@ void OS_Haiku::run() {  	main_loop->finish();  } -String OS_Haiku::get_name() { +String OS_Haiku::get_name() const {  	return "Haiku";  } @@ -133,6 +133,8 @@ Error OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p  	window->Show();  	visual_server->init(); +	camera_server = memnew(CameraServer); +  	AudioDriverManager::initialize(p_audio_driver);  	return OK; @@ -148,6 +150,8 @@ void OS_Haiku::finalize() {  	visual_server->finish();  	memdelete(visual_server); +	memdelete(camera_server); +  	memdelete(input);  #if defined(OPENGL_ENABLED) @@ -203,6 +207,10 @@ void OS_Haiku::set_cursor_shape(CursorShape p_shape) {  	//ERR_PRINT("set_cursor_shape() NOT IMPLEMENTED");  } +OS::CursorShape OS_Haiku::get_cursor_shape() const { +	// TODO: implement get_cursor_shape +} +  void OS_Haiku::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {  	// TODO  } diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h index d7eac10635..70d78a1978 100644 --- a/platform/haiku/os_haiku.h +++ b/platform/haiku/os_haiku.h @@ -38,6 +38,7 @@  #include "haiku_direct_window.h"  #include "main/input_default.h"  #include "servers/audio_server.h" +#include "servers/camera_server.h"  #include "servers/visual_server.h"  class OS_Haiku : public OS_Unix { @@ -49,6 +50,7 @@ private:  	VisualServer *visual_server;  	VideoMode current_video_mode;  	int video_driver_index; +	CameraServer *camera_server;  #ifdef MEDIA_KIT_ENABLED  	AudioDriverMediaKit driver_media_kit; @@ -74,7 +76,7 @@ public:  	OS_Haiku();  	void run(); -	virtual String get_name(); +	virtual String get_name() const;  	virtual MainLoop *get_main_loop() const; @@ -86,6 +88,7 @@ public:  	virtual Point2 get_mouse_position() const;  	virtual int get_mouse_button_state() const;  	virtual void set_cursor_shape(CursorShape p_shape); +	virtual CursorShape get_cursor_shape() const;  	virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot);  	virtual int get_screen_count() const;  |