Man Over Board
Loading...
Searching...
No Matches
global.h File Reference

Declares globally used constants and types. More...

#include <stdlib.h>
#include <stdio.h>

Data Structures

struct  BitMap
 Represents a bitmap image using a pointer to pixel data and its dimensions. More...
 

Macros

#define Pterm(rv)
 
#define SCREEN_WIDTH   640l
 Screen width in pixels.
 
#define SCREEN_HEIGHT   400l
 Screen height in pixels.
 
#define SCREEN_BUFFER_SIZE   (SCREEN_WIDTH / (sizeof(long) * 8)) * SCREEN_HEIGHT
 Screen buffer size calculation.
 
#define L_SB_ALIGN   256
 
#define TODO()
 Marks a function as not yet implemented.
 

Typedefs

typedef unsigned char u8
 8-bit unsigned integer.
 
typedef unsigned int u16
 16-bit unsigned integer.
 
typedef unsigned long u32
 32-bit unsigned integer.
 
typedef char i8
 8-bit signed integer.
 
typedef int i16
 16-bit signed integer.
 
typedef long i32
 32-bit signed integer.
 
typedef u32 Screen
 Type alias for an unsigned long representing a screen.
 

Enumerations

enum  Color { BLACK = 1 , WHITE = 0 }
 Defines color constants. More...
 
enum  Bool { True = 1 , False = 0 }
 Boolean enumeration. More...
 

Detailed Description

Declares globally used constants and types.

This header file contains definitions for common numeric types, screen-related type aliases, color enumerations, and global constants. It follows the Rust-style naming convention for type definitions.

Macro Definition Documentation

◆ L_SB_ALIGN

#define L_SB_ALIGN   256

Long alignment of screen buffer

◆ Pterm

#define Pterm ( rv)
Value:
exit(rv)

◆ SCREEN_BUFFER_SIZE

#define SCREEN_BUFFER_SIZE   (SCREEN_WIDTH / (sizeof(long) * 8)) * SCREEN_HEIGHT

Screen buffer size calculation.

The buffer size is determined by dividing the screen width by the number of bits in a long (assumed to be 32) and multiplying by the screen height.

◆ TODO

#define TODO ( )
Value:
printf("%s::%d : Unimplemented Function! Exiting.\n", __FILE__, __LINE__); \
Pterm(-1);

Marks a function as not yet implemented.

This macro prints an error message with the filename and line number, then terminates the program with a nonzero exit code.

Typedef Documentation

◆ Screen

typedef u32 Screen

Type alias for an unsigned long representing a screen.

Screens are frequently passed around in the program, so this alias helps avoid simple errors.

Enumeration Type Documentation

◆ Bool

enum Bool

Boolean enumeration.

Defines True as 1 and False as 0 for boolean operations.

◆ Color

enum Color

Defines color constants.

This enumeration represents black and white color values, using 1 for black and 0 for white.