Skip to content

Commit

Permalink
Pads pressure fix???
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSant0s committed Jun 28, 2023
1 parent ee21d0c commit f05e6d8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions bin/pads.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const dark_gray = Color.new(128, 128, 128, 32);
const opaque = Color.new(128, 128, 128, 128);
const translucent = Color.new(128, 128, 128, 60);

const font = new Font();
const font = new Font("fonts/minecraft.ttf");
font.color = Color.new(128, 0, 255);
font.scale = 0.4f;
font.scale = Math.fround(0.4);

const circle = new Image("pads/circle.png", VRAM);
const cross = new Image("pads/cross.png", VRAM);
Expand Down
12 changes: 6 additions & 6 deletions src/ath_shape.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static JSValue athena_point_draw(JSContext *ctx, JSValue this_val, int argc, JSV
JS_ToUint32(ctx, &color, argv[2]);

drawPixel(x, y, color);
return 0;
return JS_UNDEFINED;
}

static JSValue athena_line_draw(JSContext *ctx, JSValue this_val, int argc, JSValueConst *argv){
Expand All @@ -30,7 +30,7 @@ static JSValue athena_line_draw(JSContext *ctx, JSValue this_val, int argc, JSVa
JS_ToUint32(ctx, &color, argv[4]);

drawLine(x1, y1, x2, y2, color);
return 0;
return JS_UNDEFINED;
}

static JSValue athena_triangle_draw(JSContext *ctx, JSValue this_val, int argc, JSValueConst *argv){
Expand All @@ -54,7 +54,7 @@ static JSValue athena_triangle_draw(JSContext *ctx, JSValue this_val, int argc,
drawTriangle_gouraud(x1, y1, x2, y2, x3, y3, color1, color2, color3);
}

return 0;
return JS_UNDEFINED;
}

static JSValue athena_quad_draw(JSContext *ctx, JSValue this_val, int argc, JSValueConst *argv){
Expand All @@ -81,7 +81,7 @@ static JSValue athena_quad_draw(JSContext *ctx, JSValue this_val, int argc, JSVa
drawQuad_gouraud(x1, y1, x2, y2, x3, y3, x4, y4, color1, color2, color3, color4);
}

return 0;
return JS_UNDEFINED;
}

static JSValue athena_rect_draw(JSContext *ctx, JSValue this_val, int argc, JSValueConst *argv){
Expand All @@ -95,7 +95,7 @@ static JSValue athena_rect_draw(JSContext *ctx, JSValue this_val, int argc, JSVa
JS_ToUint32(ctx, &color, argv[4]);

drawRect(x, y, w, h, color);
return 0;
return JS_UNDEFINED;
}

static JSValue athena_circle_draw(JSContext *ctx, JSValue this_val, int argc, JSValueConst *argv){
Expand All @@ -110,7 +110,7 @@ static JSValue athena_circle_draw(JSContext *ctx, JSValue this_val, int argc, JS
if (argc == 5) filled = JS_ToBool(ctx, argv[4]);

drawCircle(x, y, r, color, filled);
return 0;
return JS_UNDEFINED;
}

static const JSCFunctionListEntry module_funcs[] = {
Expand Down
2 changes: 1 addition & 1 deletion src/include/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef struct {
GSTEXTURE* texture;
} model;

typedef u32 Color;
typedef u64 Color;
#define A(color) ((u8)(color >> 24 & 0xFF))
#define B(color) ((u8)(color >> 16 & 0xFF))
#define G(color) ((u8)(color >> 8 & 0xFF))
Expand Down
1 change: 0 additions & 1 deletion src/pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ void pad_init()
dbgprintf("PortMax: %d\n", padGetPortMax());
dbgprintf("SlotMax: %d\n", padGetSlotMax(port));


if((ret = padPortOpen(port, slot, padBuf)) == 0) {
dbgprintf("padOpenPort failed: %d\n", ret);
SleepThread();
Expand Down

0 comments on commit f05e6d8

Please sign in to comment.