Skip to content

Commit

Permalink
very minor fix and bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphGL committed May 15, 2024
1 parent 7921088 commit 15f09ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Maintainer: RaphGL <[email protected]>
pkgname=neosent-git
pkgver=v1.2
pkgver=v1.3
pkgrel=1
epoch=1
pkgdesc="Suckful Sent"
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project(
'neosent', 'c',
default_options: ['c_std=c11', 'b_buildtype=release', 'b_ndebug=true'],
default_options: ['c_std=c11', 'buildtype=release', 'b_ndebug=true'],
version: '1.2'
)

Expand Down
12 changes: 7 additions & 5 deletions src/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ ns_renderer_check_image_validity(const vec_Vector *token_vec) {
if (access(token.content, F_OK) != 0) {
fprintf(stderr, "Error: %s declared at %d:%d does not exist.\n",
token.content, token.linenum, token.colnum);
// todo: remove once relative paths are supported
perror("Neosent only supports absolute paths for now. Make sure your "
"path is valid and absolute.");
is_valid = false;
}
}
Expand Down Expand Up @@ -122,8 +125,8 @@ ns_Renderer ns_renderer_create(char *title, char *font_file, size_t font_size,
// --- Initialize image texture cache
size_t image_count = ns_renderer_check_image_validity(token_vec);
struct hashmap *img_texture_cache =
hashmap_new(sizeof(ImageKV), image_count, 0, 0, __img_hash,
__img_compare, NULL, NULL);
hashmap_new(sizeof(ImageKV), image_count, 0, 0, __img_hash, __img_compare,
NULL, NULL);

for (size_t i = 0; i < vec_len(token_vec); i++) {
ns_Item token = vec_get(token_vec, i);
Expand All @@ -144,7 +147,6 @@ ns_Renderer ns_renderer_create(char *title, char *font_file, size_t font_size,
.path = token.content,
});


SDL_FreeSurface(image_surface);
}
}
Expand Down Expand Up @@ -274,8 +276,8 @@ void ns_renderer_draw(ns_Renderer *renderer, const vec_Vector *token_vec,
const size_t page) {
ns_Item item = vec_get(token_vec, page);
renderer->curr_page = page;
SDL_GetWindowSize(renderer->window, &renderer->win_size.x,
&renderer->win_size.y);
SDL_GetRendererOutputSize(renderer->renderer, &renderer->win_size.x,
&renderer->win_size.y);

SDL_SetRenderDrawColor(renderer->renderer, renderer->bg.r, renderer->bg.g,
renderer->bg.b, renderer->bg.a);
Expand Down

0 comments on commit 15f09ba

Please sign in to comment.