/* Web64 SDK header printout: web64/game.h * Generated by scripts/copy-web64-ide-source.mjs. * The IDE resolves this header as a read-only virtual SDK document. */ #ifndef WEB64_GAME_H #define WEB64_GAME_H #include #ifndef WEB64_SUBPIXEL_BITS #define WEB64_SUBPIXEL_BITS 4 #endif #if WEB64_SUBPIXEL_BITS < 1 || WEB64_SUBPIXEL_BITS > 6 #error WEB64_SUBPIXEL_BITS must be between 1 and 6 #endif #define WEB64_SUBPIXEL_ONE ((uint16_t)(1U << WEB64_SUBPIXEL_BITS)) #define WEB64_ADDRESS(pointer) ((uint16_t)(pointer)) #define WEB64_POS_FROM_PX(value) ((web64_pos_t)((uint16_t)(value) << WEB64_SUBPIXEL_BITS)) #define WEB64_POS_TO_PX(value) ((uint16_t)(value) >> WEB64_SUBPIXEL_BITS) #define WEB64_POS_FRACTION(value) ((uint8_t)((value) & (WEB64_SUBPIXEL_ONE - 1U))) #define WEB64_VEL_FROM_PX(value) ((web64_vel_t)((int16_t)(value) << WEB64_SUBPIXEL_BITS)) #define WEB64_VEL_TO_PX(value) ((int16_t)(value) >> WEB64_SUBPIXEL_BITS) typedef uint16_t web64_pos_t; typedef int16_t web64_vel_t; typedef struct { web64_pos_t x; web64_pos_t y; } Web64GamePoint; typedef struct { web64_vel_t x; web64_vel_t y; } Web64GameDelta; typedef struct { uint16_t x; uint16_t y; uint8_t width; uint8_t height; } Web64GameBox; #endif