Skip to content

Commit

Permalink
add doxygen comments
Browse files Browse the repository at this point in the history
  • Loading branch information
petrkucerak committed May 4, 2021
1 parent dc9883c commit 166d114
Showing 1 changed file with 53 additions and 18 deletions.
71 changes: 53 additions & 18 deletions data_structures.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*******************************************************************
Data structures definitions for project apoman for MicroZed based MZ_APO board
designed by Petr Porazil at PiKRON
data_structures.c - file with definitions of used data structures
(C) Copyright 2021 by Petr Kucera and Lukas Nejezchleb
e-mails: kucerp28@fel.cvut.cz , nejezluk@fel.cvut.cz
license: any combination of GPL, LGPL, MPL or BSD licenses
*******************************************************************/
/**
* @file data_structures.h
* @author Lukas Nejezchleb (nejezluk@fel.cvut.cz), Petr Kucera (kucerp28@fel.cvut.cz)
* @brief File with definitions of data structures used across modules like fb data (data about next frame on the screeen), map data (data about currently played map)
* @version 0.1
* @date 2021-05-04
*
* @copyright Copyright (c) 2021
*
*/

#ifndef DATA_STRUCTURES_H
#define DATA_STRUCTURES_H
Expand All @@ -16,19 +16,31 @@
#include <pthread.h>
#include "map_template.h"

/**
* @brief the buffer structure
*
*/
typedef struct
{
int width;
int height;
uint16_t *fb;
} fb_data;

/**
* @brief the coords structure
*
*/
typedef struct
{
int x;
int y;
} coords;

/**
* @brief the basic map metadatas
*
*/
typedef struct
{
int width;
Expand All @@ -39,12 +51,20 @@ typedef struct
coords pacman_spawn;
} map_data;

/**
* @brief thread data type
*
*/
typedef struct
{
bool quit;
char last_read;
} read_thread_data_type;

/**
* @brief the pac-man metadatas
*
*/
typedef struct
{
coords location;
Expand All @@ -58,6 +78,10 @@ extern read_thread_data_type read_thread_data;
extern pthread_mutex_t mtx;
extern pthread_cond_t character_has_been_read;

/**
* @brief peripherals config data
*
*/
typedef struct
{
unsigned char *lcd_mem_base;
Expand All @@ -66,46 +90,57 @@ typedef struct
int lcd_h;
} peripherals_data_t;

/**
* @brief data necessary for game initialization
*
*/
typedef struct
{
int pacman_lives;
int ghost_nr;
map_template *map;
} game_init_data_t;

/**
* @brief the ghost metadatas
*
*/
typedef struct
{
bool moving_randomly;
bool scared;
coords location;
coords direction;
uint16_t color;
}ghost_type;


} ghost_type;

/**
* place where is the coin drawn, pacman can walk accross it
* @brief place where is the coin drawn, pacman can walk accross it
*
*/
#define COIN 3

/**
* black place on the map, pacman is allowed to walk there
* @brief black place on the map, pacman is allowed to walk there
*
*/
#define PASSAGE 1

/**
* place that will be drawn in color to show where the wall is
* @brief place that will be drawn in color to show where the wall is
*
*/
#define WALL 2

/**
* black place on the map, pacman is not allowed there
* @brief black place on the map, pacman is not allowed there
*
*/
#define BLOCKED 0

/**
* place where is the supercoin drawn, pacman can walk accross it
* @brief place where is the supercoin drawn, pacman can walk accross it
*
*/
#define SUPERCOIN 4

Expand Down

0 comments on commit 166d114

Please sign in to comment.