Skip to content

Commit 9a6006b

Browse files
committed
big release
1 parent ffbde3a commit 9a6006b

File tree

11 files changed

+67
-44
lines changed

11 files changed

+67
-44
lines changed

blackjack/application.fam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ App(
44
apptype=FlipperAppType.EXTERNAL,
55
entry_point="blackjack_app",
66
cdefines=["APP_BLACKJACK"],
7-
requires=["gui","storage"],
7+
requires=["gui","storage","canvas"],
88
stack_size=2 * 1024,
99
order=30,
1010
fap_icon="blackjack_10px.png",

blackjack/blackjack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <stdlib.h>
44
#include <dolphin/dolphin.h>
55
#include <dialogs/dialogs.h>
6+
#include <gui/canvas_i.h>
7+
68
#include <math.h>
79
#include "util.h"
810
#include "defines.h"

builds/unleashed_blackjack.fap

-148 Bytes
Binary file not shown.

builds/unleashed_solitaire.fap

-1.53 KB
Binary file not shown.

builds/vanilla_blackjack.fap

-148 Bytes
Binary file not shown.

builds/vanilla_solitaire.fap

1.37 KB
Binary file not shown.

common/card.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ int first_non_flipped_card(Hand hand) {
239239
void draw_hand_column(Hand hand, int16_t pos_x, int16_t pos_y, int8_t highlight, Canvas *const canvas) {
240240
if (hand.index == 0) {
241241
draw_card_space(pos_x, pos_y, highlight > 0, canvas);
242+
if(highlight==0)
243+
draw_rounded_box(canvas, pos_x, pos_y, CARD_WIDTH, CARD_HEIGHT,
244+
Inverse);
242245
return;
243246
}
244247

@@ -275,6 +278,9 @@ void draw_hand_column(Hand hand, int16_t pos_x, int16_t pos_y, int8_t highlight,
275278
for (int i = hStart; i < loopEnd; i++, pos+=4) {
276279
if (hand.cards[i].flipped) {
277280
draw_card_back_at(pos_x, pos_y + pos, canvas);
281+
if(i==highlight)
282+
draw_rounded_box(canvas, pos_x+1, pos_y + pos+1, CARD_WIDTH - 2, CARD_HEIGHT - 2,
283+
Inverse);
278284
} else {
279285
draw_card_at_colored(pos_x, pos_y + pos, hand.cards[i].pip, hand.cards[i].character,
280286
(i == highlight),

common/ui.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ bool test_pixel(uint8_t *data, uint8_t x, uint8_t y, uint8_t w) {
6868
}
6969

7070
uint8_t* get_buffer(Canvas *const canvas){
71-
return canvas_get_buffer(canvas);
71+
return canvas->fb.tile_buf_ptr;
72+
// return canvas_get_buffer(canvas);
7273
}
7374
uint8_t* make_buffer(){
74-
return malloc(sizeof(uint8_t) * 8 * 126);
75+
return malloc(sizeof(uint8_t) * 8 * 128);
7576
}
7677
void clone_buffer(uint8_t* canvas, uint8_t* data){
77-
for(int i=0;i<1008;i++){
78+
for(int i=0;i<1024;i++){
7879
data[i]= canvas[i];
7980
}
8081
}
@@ -165,7 +166,7 @@ void invert_rectangle(Canvas *const canvas, int16_t x, int16_t y, uint8_t w, uin
165166
}
166167

167168
uint8_t *image_data(Canvas *const canvas, const Icon *icon) {
168-
uint8_t *data = malloc(sizeof(uint8_t) * 8 * 126);
169+
uint8_t *data = malloc(sizeof(uint8_t) * 8 * 128);
169170
uint8_t *screen = canvas->fb.tile_buf_ptr;
170171
canvas->fb.tile_buf_ptr = data;
171172
canvas_draw_icon(canvas, 0, 0, icon);

common/ui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ void draw_line(Canvas *const canvas, int16_t x1, int16_t y1, int16_t x2, int16_t
5353
bool in_screen(int16_t x, int16_t y);
5454

5555
void ui_cleanup();
56-
56+
uint8_t* get_buffer(Canvas *const canvas);
5757
uint8_t* make_buffer();
5858
void clone_buffer(uint8_t* canvas, uint8_t* data);

solitaire/defines.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ typedef struct {
3131
Card card;
3232
int8_t deck;
3333
int indexes[4];
34-
int8_t x;
35-
int8_t y;
34+
float x;
35+
float y;
3636
float vx;
3737
float vy;
3838
bool started;

0 commit comments

Comments
 (0)