dev: norm
This commit is contained in:
parent
1c023df1ff
commit
a93af5c48f
4 changed files with 26 additions and 23 deletions
|
|
@ -21,32 +21,35 @@ typedef struct s_in_assetsocket
|
|||
// This function is implemented in embedassets.sh
|
||||
const t_embeddedasset *mlx3ds_assets_get(const char *name);
|
||||
|
||||
t_assetsocket mlx3ds_assets_open(const char *name) {
|
||||
t_assetsocket mlx3ds_assets_open(const char *name)
|
||||
{
|
||||
const t_embeddedasset *asset;
|
||||
t_in_assetsocket *r;
|
||||
|
||||
asset = mlx3ds_assets_get(name);
|
||||
if (!asset)
|
||||
return NULL;
|
||||
return (NULL);
|
||||
r = malloc(sizeof(t_in_assetsocket));
|
||||
if (!r)
|
||||
return NULL;
|
||||
return (NULL);
|
||||
r->asset = asset;
|
||||
r->i = 0;
|
||||
return r;
|
||||
return (r);
|
||||
}
|
||||
|
||||
size_t mlx3ds_assets_read(t_assetsocket asset, void *buf, size_t count) {
|
||||
t_in_assetsocket *asset_ = asset;
|
||||
size_t mlx3ds_assets_read(t_assetsocket asset, void *buf, size_t count)
|
||||
{
|
||||
t_in_assetsocket *asset_ = asset;
|
||||
|
||||
if (count > asset_->asset->size - asset_->i)
|
||||
count = asset_->asset->size - asset_->i;
|
||||
|
||||
memcpy(buf, asset_->asset->data + asset_->i, count);
|
||||
asset_->i += count;
|
||||
return count;
|
||||
return (count);
|
||||
}
|
||||
|
||||
void mlx3ds_assets_close(t_assetsocket asset) {
|
||||
void mlx3ds_assets_close(t_assetsocket asset)
|
||||
{
|
||||
free(asset);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@
|
|||
/// @param msg Message to write. Must use less than 38 colons.
|
||||
void mlx3ds_internal_fatalerror(const char *msg);
|
||||
|
||||
struct s_internal_win;
|
||||
struct s_internal_win;
|
||||
|
||||
/// @brief Content of the mlx connection identifier.
|
||||
typedef struct s_internal_mlx
|
||||
{
|
||||
/// @brief is true after mlx_init() was called, is false before.
|
||||
bool is_init_called;
|
||||
bool is_init_called;
|
||||
/// @brief Window displayed on the top screen.
|
||||
struct s_internal_win *top_window;
|
||||
} t_internal_mlx;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue