Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Kode/Kinc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7475bd06a9d56209a2b9d8c46e201fdb0a38c81e
Choose a base ref
...
head repository: Kode/Kinc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e2a61ca04ad96a491949c352232e39922976034d
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on Jul 27, 2021

  1. Fix new clang warnings

    RobDangerous committed Jul 27, 2021
    Copy the full SHA
    edbcc91 View commit details
  2. Fix #632

    RobDangerous committed Jul 27, 2021
    Copy the full SHA
    e2a61ca View commit details
Original file line number Diff line number Diff line change
@@ -51,17 +51,17 @@ void kinc_g5_draw_indexed_vertices_instanced(int instanceCount) {}

void kinc_g5_draw_indexed_vertices_instanced_from_to(int instanceCount, int start, int count) {}

static bool has_depth = false;
bool kinc_internal_metal_has_depth = false;

extern "C" bool kinc_internal_current_render_target_has_depth() {
return has_depth;
return kinc_internal_metal_has_depth;
}

void kinc_g5_begin(kinc_g5_render_target_t *renderTarget, int window) {
CAMetalLayer* metalLayer = getMetalLayer();
drawable = [metalLayer nextDrawable];

has_depth = renderTarget->impl._depthTex != nil;
kinc_internal_metal_has_depth = renderTarget->impl._depthTex != nil;

if (depthBits > 0 && (depthTexture == nil || depthTexture.width != drawable.texture.width || depthTexture.height != drawable.texture.height)) {
MTLTextureDescriptor* descriptor = [MTLTextureDescriptor new];
Original file line number Diff line number Diff line change
@@ -146,7 +146,11 @@ void kinc_g5_command_list_set_index_buffer(kinc_g5_command_list_t *list, struct
kinc_g5_internal_index_buffer_set(buffer);
}

extern bool kinc_internal_metal_has_depth;

void kinc_g5_command_list_set_render_targets(kinc_g5_command_list_t *list, struct kinc_g5_render_target **targets, int count) {
kinc_internal_metal_has_depth = targets[0]->impl._depthTex != nil;

if (targets[0]->contextId < 0) {
for (int i = 0; i < 8; ++i) lastRenderTargets[i] = nullptr;
kinc_g5_internal_new_render_pass(nullptr, 1, false, 0, 0, 0.0f, 0);
6 changes: 1 addition & 5 deletions Sources/kinc/audio1/soundstream.c
Original file line number Diff line number Diff line change
@@ -10,13 +10,9 @@

static kinc_a1_sound_stream_t streams[256];
static int nextStream = 0;
static uint8_t *buffer;
static uint8_t buffer[1024 * 10];
static int bufferIndex;

void initSoundStreams() {
buffer = (uint8_t *)malloc(1024 * 10);
}

kinc_a1_sound_stream_t *kinc_a1_sound_stream_create(const char *filename, bool looping) {
kinc_a1_sound_stream_t *stream = &streams[nextStream];
stream->decoded = false;
2 changes: 1 addition & 1 deletion Sources/kinc/graphics1/graphics.c
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ void kinc_g1_init(int width, int height) {
kinc_g4_texture_init(&texture, width, height, KINC_IMAGE_FORMAT_RGBA32);
kinc_internal_g1_tex_width = texture.tex_width;

kinc_internal_g1_image = (int *)kinc_g4_texture_lock(&texture);
kinc_internal_g1_image = (uint32_t *)kinc_g4_texture_lock(&texture);
for (int y = 0; y < texture.tex_height; ++y) {
for (int x = 0; x < texture.tex_width; ++x) {
kinc_internal_g1_image[y * texture.tex_width + x] = 0;
2 changes: 1 addition & 1 deletion Sources/kinc/input/mouse.h
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ void kinc_internal_mouse_trigger_scroll(int window, int delta);
void kinc_internal_mouse_trigger_enter_window(int window);
void kinc_internal_mouse_trigger_leave_window(int window);
void kinc_internal_mouse_lock(int window);
void kinc_internal_mouse_unlock();
void kinc_internal_mouse_unlock(void);
void kinc_internal_mouse_window_activated(int window);
void kinc_internal_mouse_window_deactivated(int window);

50 changes: 25 additions & 25 deletions Sources/kinc/system.c
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
#include <string.h>

#if !defined(KORE_HTML5) && !defined(KORE_ANDROID) && !defined(KORE_WINDOWS) && !defined(KORE_CONSOLE)
double kinc_time() {
double kinc_time(void) {
return kinc_timestamp() / kinc_frequency();
}
#endif
@@ -79,37 +79,37 @@ void kinc_set_logout_callback(void (*value)(void)) {
logout_callback = value;
}

void kinc_internal_update_callback() {
void kinc_internal_update_callback(void) {
if (update_callback != NULL) {
update_callback();
}
}

void kinc_internal_foreground_callback() {
void kinc_internal_foreground_callback(void) {
if (foreground_callback != NULL) {
foreground_callback();
}
}

void kinc_internal_resume_callback() {
void kinc_internal_resume_callback(void) {
if (resume_callback != NULL) {
resume_callback();
}
}

void kinc_internal_pause_callback() {
void kinc_internal_pause_callback(void) {
if (pause_callback != NULL) {
pause_callback();
}
}

void kinc_internal_background_callback() {
void kinc_internal_background_callback(void) {
if (background_callback != NULL) {
background_callback();
}
}

void kinc_internal_shutdown_callback() {
void kinc_internal_shutdown_callback(void) {
if (shutdown_callback != NULL) {
shutdown_callback();
}
@@ -121,14 +121,14 @@ void kinc_internal_drop_files_callback(wchar_t *filePath) {
}
}

char *kinc_internal_cut_callback() {
char *kinc_internal_cut_callback(void) {
if (cut_callback != NULL) {
return cut_callback();
}
return NULL;
}

char *kinc_internal_copy_callback() {
char *kinc_internal_copy_callback(void) {
if (copy_callback != NULL) {
return copy_callback();
}
@@ -141,13 +141,13 @@ void kinc_internal_paste_callback(char *value) {
}
}

void kinc_internal_login_callback() {
void kinc_internal_login_callback(void) {
if (login_callback != NULL) {
login_callback();
}
}

void kinc_internal_logout_callback() {
void kinc_internal_logout_callback(void) {
if (logout_callback != NULL) {
logout_callback();
}
@@ -157,7 +157,7 @@ static bool running = false;
// static bool showWindowFlag = true;
static char application_name[1024] = {"Kinc Application"};

const char *kinc_application_name() {
const char *kinc_application_name(void) {
return application_name;
}

@@ -169,7 +169,7 @@ void kinc_set_application_name(const char *name) {
void shutdownMetalCompute(void);
#endif

void kinc_stop() {
void kinc_stop(void) {
running = false;

// TODO (DK) destroy graphics + windows, but afaik Application::~Application() was never called, so it's the same behavior now as well
@@ -183,13 +183,13 @@ void kinc_stop() {
#endif
}

bool kinc_internal_frame() {
bool kinc_internal_frame(void) {
kinc_internal_update_callback();
kinc_internal_handle_messages();
return running;
}

void kinc_start() {
void kinc_start(void) {
running = true;

#if !defined(KORE_HTML5) && !defined(KORE_TIZEN)
@@ -206,16 +206,16 @@ void kinc_start() {
#endif
}

int kinc_width() {
int kinc_width(void) {
return kinc_window_width(0);
}

int kinc_height() {
int kinc_height(void) {
return kinc_window_height(0);
}

#ifndef KHA
void kinc_memory_emergency() {}
void kinc_memory_emergency(void) {}
#endif

#if !defined(KORE_SONY) && !defined(KORE_SWITCH)
@@ -255,22 +255,22 @@ bool is_save_load_broken(void) {
#define SAVE_RESULT_FAILURE 2
volatile int save_result = SAVE_RESULT_SUCCESS;

void kinc_disallow_user_change() {}
void kinc_disallow_user_change(void) {}

void kinc_allow_user_change() {}
void kinc_allow_user_change(void) {}

static uint8_t *current_file = NULL;
static size_t current_file_size = 0;

bool kinc_save_file_loaded() {
bool kinc_save_file_loaded(void) {
return true;
}

uint8_t *kinc_get_save_file() {
uint8_t *kinc_get_save_file(void) {
return current_file;
}

size_t kinc_get_save_file_size() {
size_t kinc_get_save_file_size(void) {
return current_file_size;
}

@@ -296,11 +296,11 @@ void kinc_save_save_file(const char *filename, uint8_t *data, size_t size) {
}
}

bool kinc_save_is_saving() {
bool kinc_save_is_saving(void) {
return false;
}

bool kinc_waiting_for_login() {
bool kinc_waiting_for_login(void) {
return false;
}