Refactoring some of the poker game logic again.
This commit is contained in:
55
temp/render/card.h
Normal file
55
temp/render/card.h
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <dawn/dawn.h>
|
||||
#include "../../file/asset.h"
|
||||
#include "../../display/shader.h"
|
||||
#include "../../display/primitive.h"
|
||||
#include "../../display/primitives/quad.h"
|
||||
#include "../../display/tileset.h"
|
||||
|
||||
/**
|
||||
* Initializes the Card Renderer.
|
||||
* @param poker The poker game context.
|
||||
*/
|
||||
void pokerCardInit(poker_t *poker);
|
||||
|
||||
/**
|
||||
* Returns the position a card "naturally" sits at for a given seat and slot.
|
||||
*
|
||||
* @param seat Seat that the card belongs to
|
||||
* @param slot Slot within the player/dealers' hand that the card belongs to.
|
||||
* @return A struct containing X, Z and YAW properties.
|
||||
*/
|
||||
pokerposition_t pokerCardGetPosition(uint8_t seat, uint8_t slot);
|
||||
|
||||
/**
|
||||
* Render's a given card at the specified coordinates. Card is a reused quad
|
||||
* and is re-buffered to for every draw call.
|
||||
*
|
||||
* @param poker The poker game context.
|
||||
* @param card Card to render.
|
||||
* @param x X Position (world space).
|
||||
* @param y Y Position (world space).
|
||||
* @param z Z Position (world space).
|
||||
* @param pitch Pitch angle.
|
||||
* @param yaw Yaw angle.
|
||||
* @param roll Roll angle.
|
||||
*/
|
||||
void pokerCardRender(poker_t *poker, card_t card, float x, float y, float z,
|
||||
float pitch, float yaw, float roll
|
||||
);
|
||||
|
||||
/**
|
||||
* Render's a card at a given seat and slot.
|
||||
* @param poker The poker game context.
|
||||
* @param seat Seat the card is for.
|
||||
* @param card Card to render.
|
||||
* @param slot Slot the card is for.
|
||||
*/
|
||||
void pokerCardRenderForSeat(poker_t *poker, uint8_t seat, card_t card, uint8_t slot);
|
Reference in New Issue
Block a user