Skip to content

Commit 756288b

Browse files
committed
added experimental 0.12.1 support
1 parent 5390720 commit 756288b

File tree

18 files changed

+756
-266
lines changed

18 files changed

+756
-266
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@
1414
path = SDL
1515
url = https://github.com/libsdl-org/SDL
1616
branch = SDL2
17+
[submodule "anjni"]
18+
path = anjni
19+
url = http://github.com/MFDGaming/anjni

anjni

Submodule anjni added at eab444d

ninecraft/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS src/*.c)
66

77
add_executable(ninecraft ${SOURCE_FILES} ../stb/stb_vorbis.c)
88
target_include_directories(ninecraft PUBLIC include/)
9-
target_link_libraries(ninecraft ${CMAKE_DL_LIBS} zlibstatic SDL2::SDL2 SDL2main glad ancmp)
9+
target_link_libraries(ninecraft ${CMAKE_DL_LIBS} zlibstatic SDL2::SDL2 SDL2main glad ancmp anjni)
1010
include_directories(ninecraft PUBLIC include/)

ninecraft/include/ninecraft/AppPlatform_linux.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ typedef union {
4444
extern ninecraft_options_t platform_options;
4545
extern bool is_keyboard_visible;
4646

47+
EXTERN_SYSV_WRAPPER(AppPlatform_linux$getDataUrl);
48+
void AppPlatform_linux$getDataUrl(android_string_t *ret, AppPlatform_linux *app_platform);
49+
4750
void AppPlatform_linux$saveImage(AppPlatform_linux *app_platform, android_string_t *resource_path, android_string_t *pixels, int width, int height);
4851

4952
void AppPlatform_linux$swapBuffers(AppPlatform_linux *app_platform);

ninecraft/include/ninecraft/app_platform.h

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,81 @@ typedef struct {
204204
void (*unregisterUriListener)(void *__this, void *uri_listener);
205205
} app_platform_vtable_0_11_0_t;
206206

207+
typedef struct {
208+
void (*__destroy0)(void *__this);
209+
void (*__destroy1)(void *__this);
210+
android_string_t (*getDataUrl)(void *__this);
211+
android_string_t (*getImagePath)(void *__this, android_string_t *resource_path, bool is_full);
212+
void (*loadPNG)(void *__this, image_data_0_9_0_t *image, android_string_t *resource_path, bool alpha);
213+
void (*loadTGA)(void *__this, image_data_0_9_0_t *image, android_string_t *resource_path);
214+
void (*savePNG)(void *__this, image_data_0_9_0_t *image, android_string_t *resource_path);
215+
int (*getKeyFromKeyCode)(void *__this, int code, int meta, int dev_id);
216+
void (*showKeyboard)(void *__this, android_string_t *u0, int u1, bool set, int flag);
217+
void (*hideKeyboard)(void *__this);
218+
void (*hideMousePointer)(void *__this);
219+
void (*showMousePointer)(void *__this);
220+
bool (*getPointerFocus)(void *__this);
221+
void (*setPointerFocus)(void *__this, bool set);
222+
void (*toggleSimulateTouchWithMouse)(void *__this);
223+
void (*captureScreen)(void *__this, int width, int height, unsigned int px_width, bool do_capture);
224+
void (*swapBuffers)(void *__this);
225+
android_string_t *(*getSystemRegion)(void *__this);
226+
android_string_t (*getGraphicsVendor)(void *__this);
227+
android_string_t (*getGraphicsRenderer)(void *__this);
228+
android_string_t (*getGraphicsVersion)(void *__this);
229+
android_string_t (*getGraphicsExtensions)(void *__this);
230+
void (*pickImage)(void *__this, image_picking_callback_0_11_0_t *callback);
231+
void (*setSleepEnabled)(void *__this, bool set);
232+
android_string_t *(*getExternalStoragePath)(void *__this);
233+
android_string_t *(*getInternalStoragePath)(void *__this);
234+
void (*showDialog)(void *__this, int);
235+
void (*createUserInput)(void *__this);
236+
int (*getUserInputStatus)(void *__this);
237+
android_vector_t (*getUserInput)(void *__this);
238+
void (*_tick)(void *__this);
239+
int (*getScreenWidth)(void *__this);
240+
int (*getScreenHeight)(void *__this);
241+
float (*getPixelsPerMillimeter)(void *__this);
242+
void (*openLoginWindow)(void *__this);
243+
void (*updateTextBoxText)(void *__this, android_string_t *text);
244+
bool (*isKeyboardVisible)(void *__this);
245+
minecraft_login_info_t (*getLoginInformation)(void *__this);
246+
void (*setLoginInformation)(void *__this, minecraft_login_info_t *info);
247+
void (*clearSessionIDAndRefreshToken)(void *__this);
248+
bool (*supportsVibration)(void *__this);
249+
void (*vibrate)(void *__this, int ms);
250+
minecraft_asset_t (*readAssetFile)(void *__this, android_string_t *resource_path);
251+
void (*listAssetFilesIn)(void *__this, android_string_t *, android_string_t *);
252+
android_string_t (*getDateString)(void *__this, int ms);
253+
int (*checkLicense)(void *__this);
254+
bool (*hasBuyButtonWhenInvalidLicense)(void *__this);
255+
void (*uploadPlatformDependentData)(void *__this, int length, void *data);
256+
bool (*isNetworkEnabled)(void *__this, bool set);
257+
bool (*isPowerVR)(void *__this);
258+
void (*buyGame)(void *__this);
259+
void (*finish)(void *__this);
260+
void (*launchUri)(void *__this, android_string_t *uri);
261+
bool (*useMetadataDrivenScreens)(void *__this);
262+
bool (*useXboxControlHelpers)(void *__this);
263+
bool (*useCenteredGUI)(void *__this);
264+
bool (*hasIDEProfiler)(void *__this);
265+
android_string_t (*getPlatformStringVar)(void *__this, int reserved);
266+
android_string_t (*getApplicationId)(void *__this);
267+
uint64_t (*getAvailableMemory)(void *__this);
268+
android_vector_t (*getBroadcastAddresses)(void *__this);
269+
android_string_t (*getModelName)(void *__this);
270+
android_string_t (*getDeviceId)(void *__this);
271+
android_string_t (*createUUID)(void *__this);
272+
bool (*isFirstSnoopLaunch)(void *__this);
273+
bool (*hasHardwareInformationChanged)(void *__this);
274+
bool (*isTablet)(void *__this);
275+
void (*registerUriListener)(void *__this, void *uri_listener);
276+
void (*unregisterUriListener)(void *__this, void *uri_listener);
277+
void (*setFullscreenMode)(void *__this, int mode);
278+
int (*getCaretPosition)(void *__this);
279+
} app_platform_vtable_0_12_1_t;
280+
207281
extern app_platform_vtable_0_9_0_t platform_vtable_0_9_0;
208282
extern app_platform_vtable_0_10_0_t platform_vtable_0_10_0;
209-
extern app_platform_vtable_0_11_0_t platform_vtable_0_11_0;
283+
extern app_platform_vtable_0_11_0_t platform_vtable_0_11_0;
284+
extern app_platform_vtable_0_12_1_t platform_vtable_0_12_1;

ninecraft/include/ninecraft/audio/audio_engine.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <stddef.h>
66
#include <stdint.h>
77

8+
void audio_engine_write(uint8_t *buffer, uint32_t buffer_size, uint32_t num_channels, uint32_t bits_per_sample, uint32_t freq, uint32_t format, uint32_t endianess, float gain, float pitch);
9+
810
void audio_engine_init();
911

1012
void audio_engine_destroy();

ninecraft/include/ninecraft/input/action/mouse_action.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
#ifndef NINECRAFT_INPUT_ACTION_MOUSE_ACTION_H
22
#define NINECRAFT_INPUT_ACTION_MOUSE_ACTION_H
33

4+
typedef struct {
5+
short x;
6+
short y;
7+
short dx;
8+
short dy;
9+
char button;
10+
char type;
11+
int pointer_id;
12+
} mouse_action_0_12_t;
13+
414
typedef struct {
515
short x;
616
short y;

ninecraft/include/ninecraft/input/mouse_device.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ extern void mouse_device_feed_0_2_1(mouse_device_0_2_1_t *mouse_device, char but
4343

4444
extern void mouse_device_feed_0_6(mouse_device_0_6_t *mouse_device, char button, char type, short x, short y, short dx, short dy);
4545

46+
extern void mouse_device_feed_0_12(mouse_device_0_6_t *mouse_device, char button, char type, short x, short y, short dx, short dy);
47+
4648
#endif

ninecraft/include/ninecraft/minecraft.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@
418418
#endif
419419

420420
#if defined(__i386__) || defined(_M_IX86)
421+
#define MINECRAFTCLIENT_SIZE_0_12_1 0x1B8
421422
#define MINECRAFTCLIENT_SIZE_0_11_1 0x18C
422423
#define MINECRAFTCLIENT_SIZE_0_11_0 0x13c
423424
#define MINECRAFTCLIENT_SIZE_0_10_5 0x12c
@@ -428,6 +429,7 @@
428429
#define MINECRAFTCLIENT_SIZE_0_10_0 0x12c
429430
#else
430431
#if defined(__arm__) || defined(_M_ARM)
432+
#define MINECRAFTCLIENT_SIZE_0_12_1 0x1C0
431433
#define MINECRAFTCLIENT_SIZE_0_11_1 0x190
432434
#define MINECRAFTCLIENT_SIZE_0_11_0 0x140
433435
#define MINECRAFTCLIENT_SIZE_0_10_5 0x130

ninecraft/include/ninecraft/ninecraft_store.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,14 @@ void ninecraft_store_purchase(void *ninecraft_store, android_string_gnu_t *name)
3333

3434
void ninecraft_store_query_purchases(void *ninecraft_store);
3535

36+
bool ninecraft_store_is_trial(void *ninecraft_store);
37+
38+
void ninecraft_store_purchase_game(void *ninecraft_store);
39+
40+
bool ninecraft_store_is_game_purchased(void *ninecraft_store);
41+
42+
void ninecraft_store_register_license_callback(void *ninecraft_store, void (*callback)(void));
43+
44+
void ninecraft_store_handle_license_change(void *ninecraft_store, void (*callback)(void));
45+
3646
#endif

0 commit comments

Comments
 (0)