codebase readme pass

This commit is contained in:
Ryan Fleury
2024-10-07 15:59:39 -07:00
parent 23ed5c8f5f
commit cf46ce7712
5 changed files with 114 additions and 106 deletions
-2
View File
@@ -1,2 +0,0 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
-43
View File
@@ -1,43 +0,0 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef ICO_H
#define ICO_H
////////////////////////////////
//~ rjf: ICO File Format Types
#pragma pack(push, 1)
typedef struct ICO_Header ICO_Header;
struct ICO_Header
{
U16 reserved_padding; // must be 0
U16 image_type; // if 1 -> ICO, if 2 -> CUR
U16 num_images;
};
typedef struct ICO_Entry ICO_Entry;
struct ICO_Entry
{
U8 image_width_px;
U8 image_height_px;
U8 num_colors;
U8 reserved_padding; // should be 0
union
{
U16 ico_color_planes; // in ICO
U16 cur_hotspot_x_px; // in CUR
};
union
{
U16 ico_bits_per_pixel; // in ICO
U16 cur_hotspot_y_px; // in CUR
};
U32 image_data_size;
U32 image_data_off;
};
#pragma pack(pop)
#endif // ICO_H
+29
View File
@@ -10609,6 +10609,35 @@ rd_init(CmdLine *cmdln)
U8 *opl = ptr+data.size;
// rjf: read header
#pragma pack(push, 1)
typedef struct ICO_Header ICO_Header;
struct ICO_Header
{
U16 reserved_padding; // must be 0
U16 image_type; // if 1 -> ICO, if 2 -> CUR
U16 num_images;
};
typedef struct ICO_Entry ICO_Entry;
struct ICO_Entry
{
U8 image_width_px;
U8 image_height_px;
U8 num_colors;
U8 reserved_padding; // should be 0
union
{
U16 ico_color_planes; // in ICO
U16 cur_hotspot_x_px; // in CUR
};
union
{
U16 ico_bits_per_pixel; // in ICO
U16 cur_hotspot_y_px; // in CUR
};
U32 image_data_size;
U32 image_data_off;
};
#pragma pack(pop)
ICO_Header hdr = {0};
if(ptr+sizeof(hdr) < opl)
{
-2
View File
@@ -538,7 +538,6 @@
#include "base/base_inc.h"
#include "os/os_inc.h"
#include "task_system/task_system.h"
#include "ico/ico.h"
#include "rdi_format/rdi_format_local.h"
#include "rdi_make/rdi_make_local.h"
#include "mdesk/mdesk.h"
@@ -578,7 +577,6 @@
#include "base/base_inc.c"
#include "os/os_inc.c"
#include "task_system/task_system.c"
#include "ico/ico.c"
#include "rdi_format/rdi_format_local.c"
#include "rdi_make/rdi_make_local.c"
#include "mdesk/mdesk.c"