mirror of
https://git.shylie.info/shylie/glerminal.git
synced 2024-11-22 08:50:06 +00:00
Update example, lower cell scale
This commit is contained in:
parent
8318011cf2
commit
615ea631e2
@ -37,14 +37,14 @@ namespace
|
|||||||
time = 0;
|
time = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 32; i++)
|
for (int i = 0; i < 40; i++)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < 20; j++)
|
for (int j = 0; j < 25; j++)
|
||||||
{
|
{
|
||||||
for (int k = 0; k < 16; k++)
|
for (int k = 0; k < 8; k++)
|
||||||
{
|
{
|
||||||
glerminal_set(i, j, k, 1);
|
glerminal_set(i, j, k, rand() % 2);
|
||||||
glerminal_offset(i, j, k, (rand() * rand()) % 256 - 128, (rand() * rand()) % 256 - 128);
|
glerminal_offset(i, j, k, (rand() * rand()) % 100 - 50, (rand() * rand()) % 100 - 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,24 +33,24 @@ void glerminal_flush();
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set a cell's sprite
|
* @brief Set a cell's sprite
|
||||||
* @param x position of the cell in the range [0, 32)
|
* @param x position of the cell in the range [0, 40)
|
||||||
* @param y position of the cell in the range [0, 20)
|
* @param y position of the cell in the range [0, 25)
|
||||||
* @param layer layer of the cell in the range [0, 8)
|
* @param layer layer of the cell in the range [0, 8)
|
||||||
* @param sprite sprite's index in the range [0, 256)
|
* @param sprite sprite's index in the range [0, 256)
|
||||||
*/
|
*/
|
||||||
void glerminal_set(unsigned char x, unsigned char y, unsigned char layer, unsigned char sprite);
|
void glerminal_set(unsigned char x, unsigned char y, unsigned char layer, unsigned char sprite);
|
||||||
/**
|
/**
|
||||||
* @brief Get a cell's sprite
|
* @brief Get a cell's sprite
|
||||||
* @param x position of the cell in the range [0, 32)
|
* @param x position of the cell in the range [0, 40)
|
||||||
* @param y position of the cell in the range [0, 20)
|
* @param y position of the cell in the range [0, 25)
|
||||||
* @param layer layer of the cell in the range [0, 8)
|
* @param layer layer of the cell in the range [0, 8)
|
||||||
* @return sprite index currently assigned to the cell
|
* @return sprite index currently assigned to the cell
|
||||||
*/
|
*/
|
||||||
unsigned char glerminal_get(unsigned char x, unsigned char y, unsigned char layer);
|
unsigned char glerminal_get(unsigned char x, unsigned char y, unsigned char layer);
|
||||||
/**
|
/**
|
||||||
* @brief Set a cell's offset
|
* @brief Set a cell's offset
|
||||||
* @param x position of the cell in the range [0, 32)
|
* @param x position of the cell in the range [0, 40)
|
||||||
* @param y position of the cell in the range [0, 20)
|
* @param y position of the cell in the range [0, 25)
|
||||||
* @param layer layer of the cell in the range [0, 8)
|
* @param layer layer of the cell in the range [0, 8)
|
||||||
* @param x_offset offset of the cell on the x axis in the range [-128, 127], where 0 is no offset
|
* @param x_offset offset of the cell on the x axis in the range [-128, 127], where 0 is no offset
|
||||||
* @param y_offset offset of the cell on the y axis in the range [-128, 127], where 0 is no offset
|
* @param y_offset offset of the cell on the y axis in the range [-128, 127], where 0 is no offset
|
||||||
|
@ -16,7 +16,7 @@ namespace glerminal
|
|||||||
constexpr unsigned int SCREEN_WIDTH = 1280;
|
constexpr unsigned int SCREEN_WIDTH = 1280;
|
||||||
constexpr unsigned int SCREEN_HEIGHT = 800;
|
constexpr unsigned int SCREEN_HEIGHT = 800;
|
||||||
constexpr unsigned int CELL_SIZE = GLERMINAL_CELL_SIZE;
|
constexpr unsigned int CELL_SIZE = GLERMINAL_CELL_SIZE;
|
||||||
constexpr unsigned int CELL_SCALE = 5;
|
constexpr unsigned int CELL_SCALE = 4;
|
||||||
constexpr unsigned int GRID_WIDTH = SCREEN_WIDTH / (CELL_SIZE * CELL_SCALE);
|
constexpr unsigned int GRID_WIDTH = SCREEN_WIDTH / (CELL_SIZE * CELL_SCALE);
|
||||||
constexpr unsigned int GRID_HEIGHT = SCREEN_HEIGHT / (CELL_SIZE * CELL_SCALE);
|
constexpr unsigned int GRID_HEIGHT = SCREEN_HEIGHT / (CELL_SIZE * CELL_SCALE);
|
||||||
constexpr unsigned int GRID_AREA = GRID_WIDTH * GRID_HEIGHT;
|
constexpr unsigned int GRID_AREA = GRID_WIDTH * GRID_HEIGHT;
|
||||||
|
Loading…
Reference in New Issue
Block a user