Dead code tells no tales
This commit is contained in:
parent
37da8155a4
commit
7ad14e7a3e
215 changed files with 153 additions and 56138 deletions
|
|
@ -75,29 +75,10 @@ void AudioDriverOpenSL::_buffer_callback(
|
|||
}
|
||||
|
||||
(*queueItf)->Enqueue(queueItf, ptr, 4 * buffer_size);
|
||||
|
||||
#if 0
|
||||
SLresult res;
|
||||
CallbackCntxt *pCntxt = (CallbackCntxt*)pContext;
|
||||
if(pCntxt->pData < (pCntxt->pDataBase + pCntxt->size))
|
||||
{
|
||||
res = (*queueItf)->Enqueue(queueItf, (void*) pCntxt->pData,
|
||||
2 * AUDIO_DATA_BUFFER_SIZE, SL_BOOLEAN_FALSE); /* Size given
|
||||
in bytes. */
|
||||
CheckErr(res);
|
||||
/* Increase data pointer by buffer size */
|
||||
pCntxt->pData += AUDIO_DATA_BUFFER_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void AudioDriverOpenSL::_buffer_callbacks(
|
||||
SLAndroidSimpleBufferQueueItf queueItf,
|
||||
/*SLuint32 eventFlags,
|
||||
const void * pBuffer,
|
||||
SLuint32 bufferSize,
|
||||
SLuint32 dataUsed,*/
|
||||
void *pContext) {
|
||||
|
||||
AudioDriverOpenSL *ad = (AudioDriverOpenSL *)pContext;
|
||||
|
|
@ -113,65 +94,6 @@ const char *AudioDriverOpenSL::get_name() const {
|
|||
return "Android";
|
||||
}
|
||||
|
||||
#if 0
|
||||
int AudioDriverOpenSL::thread_func(SceSize args, void *argp) {
|
||||
|
||||
AudioDriverOpenSL* ad = s_ad;
|
||||
sceAudioOutput2Reserve(AUDIO_OUTPUT_SAMPLE);
|
||||
|
||||
int half=0;
|
||||
while(!ad->exit_thread) {
|
||||
|
||||
int16_t *ptr = &ad->outbuff[AUDIO_OUTPUT_SAMPLE*2*half];
|
||||
|
||||
|
||||
|
||||
if (!ad->active) {
|
||||
|
||||
for(int i=0;i<AUDIO_OUTPUT_SAMPLE*2;i++) {
|
||||
ptr[i]=0;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
//printf("samples: %i\n",AUDIO_OUTPUT_SAMPLE);
|
||||
ad->lock();
|
||||
|
||||
ad->audio_server_process(AUDIO_OUTPUT_SAMPLE,ad->outbuff_32);
|
||||
|
||||
ad->unlock();
|
||||
|
||||
const int32_t* src_buff=ad->outbuff_32;
|
||||
|
||||
for(int i=0;i<AUDIO_OUTPUT_SAMPLE*2;i++) {
|
||||
|
||||
ptr[i]=src_buff[i]>>16;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Output 16-bit PCM STEREO data that is in pcmBuf without changing the volume */
|
||||
sceAudioOutput2OutputBlocking(
|
||||
SCE_AUDIO_VOLUME_0dB*3, //0db at 0x8000, that's obvious
|
||||
ptr
|
||||
);
|
||||
|
||||
if (half)
|
||||
half=0;
|
||||
else
|
||||
half=1;
|
||||
|
||||
}
|
||||
|
||||
sceAudioOutput2Release();
|
||||
|
||||
sceKernelExitThread(SCE_KERNEL_EXIT_SUCCESS);
|
||||
ad->thread_exited=true;
|
||||
return SCE_KERNEL_EXIT_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Error AudioDriverOpenSL::init() {
|
||||
|
||||
SLresult
|
||||
|
|
@ -228,29 +150,12 @@ void AudioDriverOpenSL::start() {
|
|||
SLboolean required[MAX_NUMBER_INTERFACES];
|
||||
SLInterfaceID iidArray[MAX_NUMBER_INTERFACES];
|
||||
|
||||
#if 0
|
||||
|
||||
for (int i=0; i<MAX_NUMBER_INTERFACES; i++)
|
||||
{
|
||||
required[i] = SL_BOOLEAN_FALSE;
|
||||
iidArray[i] = SL_IID_NULL;
|
||||
}
|
||||
// Set arrays required[] and iidArray[] for VOLUME interface
|
||||
required[0] = SL_BOOLEAN_TRUE;
|
||||
iidArray[0] = SL_IID_VOLUME;
|
||||
|
||||
// Create Output Mix object to be used by player
|
||||
res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 1,
|
||||
iidArray, required);
|
||||
#else
|
||||
|
||||
{
|
||||
const SLInterfaceID ids[1] = { SL_IID_ENVIRONMENTALREVERB };
|
||||
const SLboolean req[1] = { SL_BOOLEAN_FALSE };
|
||||
res = (*EngineItf)->CreateOutputMix(EngineItf, &OutputMix, 0, ids, req);
|
||||
}
|
||||
|
||||
#endif
|
||||
ERR_FAIL_COND(res != SL_RESULT_SUCCESS);
|
||||
// Realizing the Output Mix object in synchronous mode.
|
||||
res = (*OutputMix)->Realize(OutputMix, SL_BOOLEAN_FALSE);
|
||||
|
|
@ -308,44 +213,18 @@ void AudioDriverOpenSL::start() {
|
|||
/* Setup to receive buffer queue event callbacks */
|
||||
res = (*bufferQueueItf)->RegisterCallback(bufferQueueItf, _buffer_callbacks, this);
|
||||
ERR_FAIL_COND(res != SL_RESULT_SUCCESS);
|
||||
/* Before we start set volume to -3dB (-300mB) */
|
||||
#if 0
|
||||
res = (*OutputMix)->GetInterface(OutputMix, SL_IID_VOLUME,
|
||||
(void*)&volumeItf);
|
||||
ERR_FAIL_COND( res !=SL_RESULT_SUCCESS );
|
||||
/* Setup the data source structure for the buffer queue */
|
||||
|
||||
res = (*volumeItf)->SetVolumeLevel(volumeItf, -300);
|
||||
ERR_FAIL_COND( res !=SL_RESULT_SUCCESS );
|
||||
#endif
|
||||
last_free = 0;
|
||||
#if 1
|
||||
|
||||
//fill up buffers
|
||||
for (int i = 0; i < BUFFER_COUNT; i++) {
|
||||
/* Enqueue a few buffers to get the ball rolling */
|
||||
res = (*bufferQueueItf)->Enqueue(bufferQueueItf, buffers[i], 4 * buffer_size); /* Size given in */
|
||||
}
|
||||
#endif
|
||||
|
||||
res = (*playItf)->SetPlayState(playItf, SL_PLAYSTATE_PLAYING);
|
||||
ERR_FAIL_COND(res != SL_RESULT_SUCCESS);
|
||||
|
||||
#if 0
|
||||
res = (*bufferQueueItf)->GetState(bufferQueueItf, &state);
|
||||
ERR_FAIL_COND( res !=SL_RESULT_SUCCESS );
|
||||
while(state.count)
|
||||
{
|
||||
(*bufferQueueItf)->GetState(bufferQueueItf, &state);
|
||||
}
|
||||
/* Make sure player is stopped */
|
||||
res = (*playItf)->SetPlayState(playItf, SL_PLAYSTATE_STOPPED);
|
||||
CheckErr(res);
|
||||
/* Destroy the player */
|
||||
(*player)->Destroy(player);
|
||||
/* Destroy Output Mix object */
|
||||
(*OutputMix)->Destroy(OutputMix);
|
||||
#endif
|
||||
|
||||
active = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -565,20 +565,6 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) {
|
|||
case APP_CMD_CONFIG_CHANGED:
|
||||
case APP_CMD_WINDOW_RESIZED: {
|
||||
|
||||
#if 0
|
||||
// android blows
|
||||
if (engine->display_active) {
|
||||
|
||||
EGLint w,h;
|
||||
eglQuerySurface(engine->display, engine->surface, EGL_WIDTH, &w);
|
||||
eglQuerySurface(engine->display, engine->surface, EGL_HEIGHT, &h);
|
||||
engine->os->init_video_mode(w,h);
|
||||
//print_line("RESIZED VIDEO MODE: "+itos(w)+","+itos(h));
|
||||
engine_draw_frame(engine);
|
||||
|
||||
}
|
||||
#else
|
||||
|
||||
if (engine->display_active) {
|
||||
|
||||
EGLint w, h;
|
||||
|
|
@ -594,17 +580,6 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) {
|
|||
engine_draw_frame(engine);
|
||||
engine->animating = 1;
|
||||
|
||||
/*
|
||||
EGLint w,h;
|
||||
eglQuerySurface(engine->display, engine->surface, EGL_WIDTH, &w);
|
||||
eglQuerySurface(engine->display, engine->surface, EGL_HEIGHT, &h);
|
||||
engine->os->init_video_mode(w,h);
|
||||
//print_line("RESIZED VIDEO MODE: "+itos(w)+","+itos(h));
|
||||
|
||||
}*/
|
||||
|
||||
#endif
|
||||
|
||||
} break;
|
||||
case APP_CMD_INIT_WINDOW:
|
||||
//The window is being shown, get it ready.
|
||||
|
|
@ -617,9 +592,7 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) {
|
|||
engine->os = new OS_Android(_gfx_init, engine);
|
||||
|
||||
__android_log_print(ANDROID_LOG_INFO, "godot", "pre asdasd setup...");
|
||||
#if 0
|
||||
Error err = Main::setup("apk",2,args);
|
||||
#else
|
||||
|
||||
Error err = Main::setup("apk", 0, NULL);
|
||||
|
||||
String modules = ProjectSettings::get_singleton()->get("android/modules");
|
||||
|
|
@ -669,8 +642,6 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) {
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (!Main::start())
|
||||
return; //should exit instead and print the error
|
||||
|
||||
|
|
|
|||
|
|
@ -866,13 +866,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en
|
|||
|
||||
__android_log_print(ANDROID_LOG_INFO, "godot", "**SETUP");
|
||||
|
||||
#if 0
|
||||
char *args[]={"--test","render",NULL};
|
||||
__android_log_print(ANDROID_LOG_INFO,"godot","pre asdasd setup...");
|
||||
Error err = Main::setup("apk",2,args,false);
|
||||
#else
|
||||
Error err = Main::setup("apk", cmdlen, (char **)cmdline, false);
|
||||
#endif
|
||||
|
||||
if (err != OK) {
|
||||
__android_log_print(ANDROID_LOG_INFO, "godot", "*****UNABLE TO SETUP");
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@ void OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int
|
|||
|
||||
physics_server = memnew(PhysicsServerSW);
|
||||
physics_server->init();
|
||||
//physics_2d_server = memnew( Physics2DServerSW );
|
||||
physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>();
|
||||
physics_2d_server->init();
|
||||
|
||||
|
|
@ -160,43 +159,6 @@ void OS_Android::set_main_loop(MainLoop *p_main_loop) {
|
|||
|
||||
main_loop = p_main_loop;
|
||||
input->set_main_loop(p_main_loop);
|
||||
#if 0
|
||||
|
||||
print_line("preGS");
|
||||
FileAccess *f=memnew( FileAccessAndroid );
|
||||
print("made f %p\n",f);
|
||||
Error err = f->open("AndroidManifest.xml",FileAccess::READ);
|
||||
if (err) {
|
||||
|
||||
print("************NO FILE!!\n");
|
||||
} else {
|
||||
print("************YES FILE!!\n");
|
||||
}
|
||||
f->close();
|
||||
print_line("end");
|
||||
|
||||
|
||||
AAssetDir* aad = AAssetManager_openDir(FileAccessAndroid::asset_manager,".");
|
||||
|
||||
if (aad) {
|
||||
|
||||
print_line("DIR OPEN OK");
|
||||
|
||||
const char *fn= AAssetDir_getNextFileName(aad);
|
||||
|
||||
while(fn) {
|
||||
|
||||
print_line("FNAME: "+String(fn));
|
||||
fn= AAssetDir_getNextFileName(aad);
|
||||
}
|
||||
|
||||
AAssetDir_close(aad);
|
||||
} else {
|
||||
|
||||
print_line("DIR NO OPEN");
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void OS_Android::delete_main_loop() {
|
||||
|
|
|
|||
|
|
@ -110,11 +110,8 @@ private:
|
|||
|
||||
mutable String data_dir_cache;
|
||||
|
||||
#if 0
|
||||
AudioDriverAndroid audio_driver_android;
|
||||
#else
|
||||
//AudioDriverAndroid audio_driver_android;
|
||||
AudioDriverOpenSL audio_driver_android;
|
||||
#endif
|
||||
|
||||
const char *gl_extensions;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,16 +27,15 @@
|
|||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include <Screen.h>
|
||||
#include "os_haiku.h"
|
||||
|
||||
#include "drivers/gles2/rasterizer_gles2.h"
|
||||
#include "drivers/gles3/rasterizer_gles3.h"
|
||||
#include "main/main.h"
|
||||
#include "servers/physics/physics_server_sw.h"
|
||||
#include "servers/visual/visual_server_raster.h"
|
||||
#include "servers/visual/visual_server_wrap_mt.h"
|
||||
//#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
|
||||
#include "main/main.h"
|
||||
|
||||
#include "os_haiku.h"
|
||||
#include <Screen.h>
|
||||
|
||||
OS_Haiku::OS_Haiku() {
|
||||
#ifdef MEDIA_KIT_ENABLED
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@
|
|||
#include "servers/visual_server.h"
|
||||
|
||||
class AudioDriverIphone;
|
||||
// class RasterizerGLES2;
|
||||
|
||||
class OSIPhone : public OS_Unix {
|
||||
|
||||
|
|
@ -67,9 +66,6 @@ private:
|
|||
|
||||
uint8_t supported_orientations;
|
||||
|
||||
// Rasterizer *rasterizer;
|
||||
// RasterizerGLES2* rasterizer_gles22;
|
||||
|
||||
VisualServer *visual_server;
|
||||
PhysicsServer *physics_server;
|
||||
Physics2DServer *physics_2d_server;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "audio_server_javascript.h"
|
||||
|
||||
// FIXME: Needs to be ported to the new AudioServer API in 3.0
|
||||
#if 0
|
||||
#include "emscripten.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@
|
|||
/*************************************************************************/
|
||||
#ifndef AUDIO_SERVER_JAVASCRIPT_H
|
||||
#define AUDIO_SERVER_JAVASCRIPT_H
|
||||
|
||||
// FIXME: Needs to be ported to the new AudioServer API in 3.0
|
||||
#if 0
|
||||
#include "servers/audio_server.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "export.h"
|
||||
|
||||
#include "editor/editor_export.h"
|
||||
#include "platform/x11/logo.gen.h"
|
||||
#include "scene/resources/texture.h"
|
||||
|
|
@ -51,23 +52,4 @@ void register_x11_exporter() {
|
|||
platform->set_os_name("X11");
|
||||
|
||||
EditorExport::get_singleton()->add_export_platform(platform);
|
||||
|
||||
#if 0
|
||||
Image img(_x11_logo);
|
||||
Ref<ImageTexture> logo = memnew( ImageTexture );
|
||||
logo->create_from_image(img);
|
||||
|
||||
{
|
||||
Ref<EditorExportPlatformPC> exporter = Ref<EditorExportPlatformPC>( memnew(EditorExportPlatformPC) );
|
||||
exporter->set_binary_extension("");
|
||||
exporter->set_release_binary32("linux_x11_32_release");
|
||||
exporter->set_debug_binary32("linux_x11_32_debug");
|
||||
exporter->set_release_binary64("linux_x11_64_release");
|
||||
exporter->set_debug_binary64("linux_x11_64_debug");
|
||||
exporter->set_name("Linux X11");
|
||||
exporter->set_logo(logo);
|
||||
EditorImportExport::get_singleton()->add_export_platform(exporter);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1601,8 +1601,7 @@ void OS_X11::process_xevents() {
|
|||
Point2i pos(event.xmotion.x, event.xmotion.y);
|
||||
|
||||
if (mouse_mode == MOUSE_MODE_CAPTURED) {
|
||||
#if 1
|
||||
//Vector2 c = Point2i(current_videomode.width/2,current_videomode.height/2);
|
||||
|
||||
if (pos == Point2i(current_videomode.width / 2, current_videomode.height / 2)) {
|
||||
//this sucks, it's a hack, etc and is a little inaccurate, etc.
|
||||
//but nothing I can do, X11 sucks.
|
||||
|
|
@ -1615,17 +1614,6 @@ void OS_X11::process_xevents() {
|
|||
pos = last_mouse_pos + (pos - center);
|
||||
center = new_center;
|
||||
do_mouse_warp = window_has_focus; // warp the cursor if we're focused in
|
||||
#else
|
||||
//Dear X11, thanks for making my life miserable
|
||||
|
||||
center.x = current_videomode.width / 2;
|
||||
center.y = current_videomode.height / 2;
|
||||
pos = last_mouse_pos + (pos - center);
|
||||
if (pos == last_mouse_pos)
|
||||
break;
|
||||
XWarpPointer(x11_display, None, x11_window,
|
||||
0, 0, 0, 0, (int)center.x, (int)center.y);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!last_mouse_pos_valid) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue