aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_particles_local.h
blob: d8bb2b1c62cd18cd0808ab275757ea6992bca52a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2017 red-001 <red-001@outlook.ie>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#pragma once

#include "lua_api/l_base.h"

class ModApiParticlesLocal : public ModApiBase
{
private:
	static int l_add_particle(lua_State *L);
	static int l_add_particlespawner(lua_State *L);
	static int l_delete_particlespawner(lua_State *L);

public:
	static void Initialize(lua_State *L, int top);
};
opt">.app.NativeActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.WindowManager; public class MtNativeActivity extends NativeActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); m_MessagReturnCode = -1; m_MessageReturnValue = ""; } @Override public void onDestroy() { super.onDestroy(); } public void copyAssets() { Intent intent = new Intent(this, MinetestAssetCopy.class); startActivity(intent); } public void showDialog(String acceptButton, String hint, String current, int editType) { Intent intent = new Intent(this, MinetestTextEntry.class); Bundle params = new Bundle(); params.putString("acceptButton", acceptButton); params.putString("hint", hint); params.putString("current", current); params.putInt("editType", editType); intent.putExtras(params); startActivityForResult(intent, 101); m_MessageReturnValue = ""; m_MessagReturnCode = -1; } public static native void putMessageBoxResult(String text); /* ugly code to workaround putMessageBoxResult not beeing found */ public int getDialogState() { return m_MessagReturnCode; } public String getDialogValue() { m_MessagReturnCode = -1; return m_MessageReturnValue; } public float getDensity() { return getResources().getDisplayMetrics().density; } public int getDisplayWidth() { return getResources().getDisplayMetrics().widthPixels; } public int getDisplayHeight() { return getResources().getDisplayMetrics().heightPixels; } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == 101) { if (resultCode == RESULT_OK) { String text = data.getStringExtra("text"); m_MessagReturnCode = 0; m_MessageReturnValue = text; } else { m_MessagReturnCode = 1; } } } static { System.loadLibrary("openal"); System.loadLibrary("ogg"); System.loadLibrary("vorbis"); System.loadLibrary("ssl"); System.loadLibrary("crypto"); System.loadLibrary("gmp"); System.loadLibrary("iconv"); // We don't have to load libminetest.so ourselves, // but if we do, we get nicer logcat errors when // loading fails. System.loadLibrary("minetest"); } private int m_MessagReturnCode; private String m_MessageReturnValue; }