Skip to content

Commit

Permalink
Fix a couple of bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerdes committed Mar 21, 2022
1 parent b50e0ae commit 0b2d4d8
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions data/shaders/aim_line.glsl.golf_data
Expand Up @@ -69,7 +69,7 @@
"uniforms": [
{
"name": "aim_line_vs_params",
"size": 80,
"size": 64,
"binding": 0,
"members": [
{
Expand Down Expand Up @@ -152,7 +152,7 @@
"uniforms": [
{
"name": "aim_line_vs_params",
"size": 80,
"size": 64,
"binding": 0,
"members": [
{
Expand Down
8 changes: 4 additions & 4 deletions data/shaders/ball.glsl.golf_data
Expand Up @@ -15,7 +15,7 @@
"uniforms": [
{
"name": "ball_fs_params",
"size": 32,
"size": 16,
"binding": 0,
"members": [
{
Expand Down Expand Up @@ -52,7 +52,7 @@
"uniforms": [
{
"name": "ball_vs_params",
"size": 144,
"size": 128,
"binding": 0,
"members": [
{
Expand Down Expand Up @@ -86,7 +86,7 @@
"uniforms": [
{
"name": "ball_fs_params",
"size": 32,
"size": 16,
"binding": 0,
"members": [
{
Expand Down Expand Up @@ -123,7 +123,7 @@
"uniforms": [
{
"name": "ball_vs_params",
"size": 144,
"size": 128,
"binding": 0,
"members": [
{
Expand Down
4 changes: 2 additions & 2 deletions data/shaders/diffuse_color_material.glsl.golf_data
Expand Up @@ -39,7 +39,7 @@
"uniforms": [
{
"name": "diffuse_color_material_vs_params",
"size": 144,
"size": 128,
"binding": 0,
"members": [
{
Expand Down Expand Up @@ -97,7 +97,7 @@
"uniforms": [
{
"name": "diffuse_color_material_vs_params",
"size": 144,
"size": 128,
"binding": 0,
"members": [
{
Expand Down
4 changes: 2 additions & 2 deletions data/shaders/editor_water.glsl.golf_data
Expand Up @@ -65,7 +65,7 @@
"uniforms": [
{
"name": "editor_water_vs_params",
"size": 144,
"size": 128,
"binding": 0,
"members": [
{
Expand Down Expand Up @@ -149,7 +149,7 @@
"uniforms": [
{
"name": "editor_water_vs_params",
"size": 144,
"size": 128,
"binding": 0,
"members": [
{
Expand Down
4 changes: 2 additions & 2 deletions data/shaders/environment_material.glsl.golf_data
Expand Up @@ -82,7 +82,7 @@
"uniforms": [
{
"name": "environment_material_vs_params",
"size": 144,
"size": 128,
"binding": 0,
"members": [
{
Expand Down Expand Up @@ -183,7 +183,7 @@
"uniforms": [
{
"name": "environment_material_vs_params",
"size": 144,
"size": 128,
"binding": 0,
"members": [
{
Expand Down
4 changes: 2 additions & 2 deletions data/shaders/pass_through.glsl.golf_data
Expand Up @@ -17,7 +17,7 @@
"uniforms": [
{
"name": "pass_through_vs_params",
"size": 80,
"size": 64,
"binding": 0,
"members": [
{
Expand Down Expand Up @@ -48,7 +48,7 @@
"uniforms": [
{
"name": "pass_through_vs_params",
"size": 80,
"size": 64,
"binding": 0,
"members": [
{
Expand Down
8 changes: 4 additions & 4 deletions data/shaders/solid_color_material.glsl.golf_data
Expand Up @@ -6,7 +6,7 @@
"uniforms": [
{
"name": "solid_color_material_fs_params",
"size": 32,
"size": 16,
"binding": 0,
"members": [
{
Expand All @@ -30,7 +30,7 @@
"uniforms": [
{
"name": "solid_color_material_vs_params",
"size": 80,
"size": 64,
"binding": 0,
"members": [
{
Expand All @@ -50,7 +50,7 @@
"uniforms": [
{
"name": "solid_color_material_fs_params",
"size": 32,
"size": 16,
"binding": 0,
"members": [
{
Expand All @@ -74,7 +74,7 @@
"uniforms": [
{
"name": "solid_color_material_vs_params",
"size": 80,
"size": 64,
"binding": 0,
"members": [
{
Expand Down
1 change: 1 addition & 0 deletions data/shaders/ui.glsl
Expand Up @@ -34,6 +34,7 @@ void main() {
vec2 tc = vec2(tex_x, tex_y) + frag_texture_coord * vec2(tex_dx, tex_dy);
g_frag_color = texture(ui_texture, tc);
g_frag_color.a = alpha * (is_font*g_frag_color.x + (1.0 - is_font)*g_frag_color.a);
if (g_frag_color.a < 0.01) discard;
g_frag_color.xyz = (1.0 - is_font)*((1.0 - color.a)*g_frag_color.xyz + color.a*color.xyz) + is_font*color.xyz;
}
//@end
8 changes: 4 additions & 4 deletions data/shaders/ui.glsl.golf_data
@@ -1,7 +1,7 @@
{
"glsl330": {
"fs": {
"source": "#version 330\n\nuniform vec4 ui_fs_params[3];\nuniform sampler2D ui_texture;\n\nin vec2 frag_texture_coord;\nlayout(location = 0) out vec4 g_frag_color;\n\nvoid main()\n{\n vec2 tc = vec2(ui_fs_params[1].y, ui_fs_params[1].z) + (frag_texture_coord * vec2(ui_fs_params[1].w, ui_fs_params[2].x));\n g_frag_color = texture(ui_texture, tc);\n g_frag_color.w = ui_fs_params[1].x * ((ui_fs_params[2].y * g_frag_color.x) + ((1.0 - ui_fs_params[2].y) * g_frag_color.w));\n vec3 _93 = (((g_frag_color.xyz * (1.0 - ui_fs_params[0].w)) + (ui_fs_params[0].xyz * ui_fs_params[0].w)) * (1.0 - ui_fs_params[2].y)) + (ui_fs_params[0].xyz * ui_fs_params[2].y);\n g_frag_color = vec4(_93.x, _93.y, _93.z, g_frag_color.w);\n}\n\n",
"source": "#version 330\n\nuniform vec4 ui_fs_params[3];\nuniform sampler2D ui_texture;\n\nin vec2 frag_texture_coord;\nlayout(location = 0) out vec4 g_frag_color;\n\nvoid main()\n{\n vec2 tc = vec2(ui_fs_params[1].y, ui_fs_params[1].z) + (frag_texture_coord * vec2(ui_fs_params[1].w, ui_fs_params[2].x));\n g_frag_color = texture(ui_texture, tc);\n g_frag_color.w = ui_fs_params[1].x * ((ui_fs_params[2].y * g_frag_color.x) + ((1.0 - ui_fs_params[2].y) * g_frag_color.w));\n if (g_frag_color.w < 0.00999999977648258209228515625)\n {\n discard;\n }\n vec3 _101 = (((g_frag_color.xyz * (1.0 - ui_fs_params[0].w)) + (ui_fs_params[0].xyz * ui_fs_params[0].w)) * (1.0 - ui_fs_params[2].y)) + (ui_fs_params[0].xyz * ui_fs_params[2].y);\n g_frag_color = vec4(_101.x, _101.y, _101.z, g_frag_color.w);\n}\n\n",
"inputs": [
{
"name": "frag_texture_coord",
Expand Down Expand Up @@ -74,7 +74,7 @@
"uniforms": [
{
"name": "ui_vs_params",
"size": 80,
"size": 64,
"binding": 0,
"members": [
{
Expand All @@ -89,7 +89,7 @@
},
"gles300": {
"fs": {
"source": "#version 300 es\nprecision mediump float;\nprecision highp int;\n\nuniform highp vec4 ui_fs_params[3];\nuniform highp sampler2D ui_texture;\n\nin highp vec2 frag_texture_coord;\nlayout(location = 0) out highp vec4 g_frag_color;\n\nvoid main()\n{\n highp vec2 tc = vec2(ui_fs_params[1].y, ui_fs_params[1].z) + (frag_texture_coord * vec2(ui_fs_params[1].w, ui_fs_params[2].x));\n g_frag_color = texture(ui_texture, tc);\n g_frag_color.w = ui_fs_params[1].x * ((ui_fs_params[2].y * g_frag_color.x) + ((1.0 - ui_fs_params[2].y) * g_frag_color.w));\n highp vec3 _93 = (((g_frag_color.xyz * (1.0 - ui_fs_params[0].w)) + (ui_fs_params[0].xyz * ui_fs_params[0].w)) * (1.0 - ui_fs_params[2].y)) + (ui_fs_params[0].xyz * ui_fs_params[2].y);\n g_frag_color = vec4(_93.x, _93.y, _93.z, g_frag_color.w);\n}\n\n",
"source": "#version 300 es\nprecision mediump float;\nprecision highp int;\n\nuniform highp vec4 ui_fs_params[3];\nuniform highp sampler2D ui_texture;\n\nin highp vec2 frag_texture_coord;\nlayout(location = 0) out highp vec4 g_frag_color;\n\nvoid main()\n{\n highp vec2 tc = vec2(ui_fs_params[1].y, ui_fs_params[1].z) + (frag_texture_coord * vec2(ui_fs_params[1].w, ui_fs_params[2].x));\n g_frag_color = texture(ui_texture, tc);\n g_frag_color.w = ui_fs_params[1].x * ((ui_fs_params[2].y * g_frag_color.x) + ((1.0 - ui_fs_params[2].y) * g_frag_color.w));\n if (g_frag_color.w < 0.00999999977648258209228515625)\n {\n discard;\n }\n highp vec3 _101 = (((g_frag_color.xyz * (1.0 - ui_fs_params[0].w)) + (ui_fs_params[0].xyz * ui_fs_params[0].w)) * (1.0 - ui_fs_params[2].y)) + (ui_fs_params[0].xyz * ui_fs_params[2].y);\n g_frag_color = vec4(_101.x, _101.y, _101.z, g_frag_color.w);\n}\n\n",
"inputs": [
{
"name": "frag_texture_coord",
Expand Down Expand Up @@ -162,7 +162,7 @@
"uniforms": [
{
"name": "ui_vs_params",
"size": 80,
"size": 64,
"binding": 0,
"members": [
{
Expand Down
4 changes: 2 additions & 2 deletions data/shaders/water_around_ball.glsl.golf_data
Expand Up @@ -44,7 +44,7 @@
"uniforms": [
{
"name": "vs_params",
"size": 80,
"size": 64,
"binding": 0,
"members": [
{
Expand Down Expand Up @@ -102,7 +102,7 @@
"uniforms": [
{
"name": "vs_params",
"size": 80,
"size": 64,
"binding": 0,
"members": [
{
Expand Down
1 change: 0 additions & 1 deletion src/common/log.c
Expand Up @@ -3,7 +3,6 @@
#include <stdbool.h>
#include <stdio.h>

#include "dbgtools/callstack.h"
#include "common/log.h"

#if GOLF_PLATFORM_ANDROID
Expand Down
4 changes: 2 additions & 2 deletions src/golf/game.c
Expand Up @@ -913,8 +913,6 @@ void golf_game_start_level(void) {
golf_entity_t *entity = &golf->level->entities.data[i];

switch (entity->type) {
case BEGIN_ANIMATION_ENTITY:
case CAMERA_ZONE_ENTITY:
case MODEL_ENTITY:
case WATER_ENTITY:
case GEO_ENTITY: {
Expand All @@ -927,6 +925,8 @@ void golf_game_start_level(void) {
}
break;
}
case BEGIN_ANIMATION_ENTITY:
case CAMERA_ZONE_ENTITY:
case BALL_START_ENTITY:
case HOLE_ENTITY:
case GROUP_ENTITY:
Expand Down
2 changes: 1 addition & 1 deletion src/golf/ui.c
Expand Up @@ -806,7 +806,7 @@ static int _golf_ui_level_select_scroll_box_name(golf_ui_layout_t *layout, const
int clicked_button_num = -1;

int num_levels = (int)CFG_NUM(game_cfg, "num_levels");
int num_rows = ceilf((float)num_levels / buttons_per_row);
int num_rows = (int)ceilf((float)num_levels / buttons_per_row);
bool locked = false;

for (int row = 0; row < num_rows; row++) {
Expand Down

0 comments on commit 0b2d4d8

Please sign in to comment.