Made strings a bit better.
This commit is contained in:
@@ -37,7 +37,8 @@ void conversationFadeUpdate() {
|
||||
diff = TIME_CURRENT - TIME_FUTURE;
|
||||
|
||||
// Now we work out the steps. Time is measured in steps which are made of
|
||||
// parts of a second.
|
||||
// parts of a second. This code assumes that the screen STARTS at the correct
|
||||
// shade.
|
||||
if(diff == FADE_STEP) {
|
||||
// First step
|
||||
BGP_REG = (
|
||||
@@ -47,7 +48,7 @@ void conversationFadeUpdate() {
|
||||
COMMON_SHADE_BRIGHTER
|
||||
);
|
||||
} else if(diff == FADE_STEP * 2) {
|
||||
// First step
|
||||
// Second step
|
||||
BGP_REG = (
|
||||
TIME_FUTURE_TYPE == TIME_FUTURE_TYPE_FADE_TO_BLACK ? COMMON_SHADE_DARKER :
|
||||
TIME_FUTURE_TYPE == TIME_FUTURE_TYPE_FADE_TO_WHITE ? COMMON_SHADE_BRIGHTER :
|
||||
@@ -55,13 +56,12 @@ void conversationFadeUpdate() {
|
||||
COMMON_SHADE_BRIGHT
|
||||
);
|
||||
} else if(diff == FADE_STEP * 3) {
|
||||
// First step
|
||||
// Third step
|
||||
BGP_REG = (
|
||||
TIME_FUTURE_TYPE == TIME_FUTURE_TYPE_FADE_TO_BLACK ? COMMON_SHADE_BLACK :
|
||||
TIME_FUTURE_TYPE == TIME_FUTURE_TYPE_FADE_TO_WHITE ? COMMON_SHADE_WHITE :
|
||||
COMMON_SHADE_NORMAL
|
||||
);
|
||||
} else if(diff == FADE_STEP * 4) {
|
||||
TIME_FUTURE_TYPE = TIME_FUTURE_TYPE_NULL;
|
||||
conversationQueueNext();
|
||||
}
|
||||
|
@@ -11,8 +11,8 @@
|
||||
#include "pause.h"
|
||||
#include "../display/common.h"
|
||||
|
||||
// There are 4 total shades, so this is all 4 shades in a second.
|
||||
#define FADE_STEP TIME_PER_SECOND / COMMON_TILE_COUNT
|
||||
// This is how many frames it takes to change each shade.
|
||||
#define FADE_STEP 20
|
||||
|
||||
void conversationFadeToBlack();
|
||||
void conversationFadeFromBlack();
|
||||
|
@@ -9,46 +9,27 @@
|
||||
#include "pause.h"
|
||||
#include "textbox.h"
|
||||
#include "fade.h"
|
||||
#include "../poker/poker.h"
|
||||
|
||||
uint16_t QUEUE_ITEM;
|
||||
|
||||
void conversationQueueInit() {
|
||||
QUEUE_ITEM = 0;
|
||||
QUEUE_ITEM = QUEUE_BEGIN;
|
||||
}
|
||||
|
||||
void conversationQueueNext() {
|
||||
BGB_printf("Queue item: %d\n", QUEUE_ITEM);
|
||||
|
||||
switch(QUEUE_ITEM) {
|
||||
// case 0:
|
||||
// conversationTextboxSetText(STR_POKER_GAME_START_DATA, STR_POKER_GAME_START_LENGTH);
|
||||
// conversationPause(3);
|
||||
// QUEUE_ITEM++;
|
||||
// break;
|
||||
|
||||
case 0:
|
||||
conversationFadeToBlack();
|
||||
QUEUE_ITEM++;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
conversationFadeFromBlack();
|
||||
QUEUE_ITEM++;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
conversationFadeToWhite();
|
||||
QUEUE_ITEM++;
|
||||
case QUEUE_BEGIN:
|
||||
conversationTextboxString(POKER_GAME_START);
|
||||
QUEUE_ITEM = QUEUE_TAKE_BLINDS;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
conversationFadeFromWhite();
|
||||
QUEUE_ITEM++;
|
||||
case QUEUE_TAKE_BLINDS:
|
||||
pokerTakeBlinds();
|
||||
conversationTextboxString(POKER_GAME_TAKING_BLINDS);
|
||||
QUEUE_ITEM = QUEUE_TAKE_BLINDS;
|
||||
break;
|
||||
|
||||
// case 2:
|
||||
// conversationTextboxSetText(STR_POKER_GAME_START_DATA, STR_POKER_GAME_START_LENGTH);
|
||||
// QUEUE_ITEM++;
|
||||
// break;
|
||||
}
|
||||
}
|
@@ -7,10 +7,12 @@
|
||||
|
||||
#pragma once
|
||||
#include "../libs.h"
|
||||
#include "HELLO.h"
|
||||
#include "POKER_GAME_START.h"
|
||||
#include "STRINGS.h"
|
||||
|
||||
extern uint16_t QUEUE_ITEM;
|
||||
|
||||
#define QUEUE_BEGIN 10
|
||||
#define QUEUE_TAKE_BLINDS 20
|
||||
|
||||
void conversationQueueInit();
|
||||
void conversationQueueNext();
|
@@ -37,6 +37,10 @@
|
||||
#define TEXTBOX_TILES_ROWS 3
|
||||
#define TEXTBOX_TILE_BLANK COMMON_TILE_3
|
||||
|
||||
#define conversationTextboxString(name) conversationTextboxSetText(\
|
||||
STR_ ## name ## _DATA, STR_ ## name ## _LENGTH\
|
||||
)
|
||||
|
||||
extern char *TEXTBOX_TEXT;
|
||||
extern uint8_t TEXTBOX_TEXT_LENGTH;
|
||||
extern uint8_t TEXTBOX_STATE;
|
||||
|
@@ -18,6 +18,9 @@ uint8_t POKER_PLAYER_DEALER;
|
||||
uint8_t POKER_PLAYER_SMALL_BLIND;
|
||||
uint8_t POKER_PLAYER_BIG_BLIND;
|
||||
|
||||
uint16_t POKER_GAME_BLINDS_CURRENT;
|
||||
uint16_t POKER_GAME_POT;
|
||||
|
||||
void pokerInit() {
|
||||
uint8_t i;
|
||||
|
||||
@@ -30,6 +33,9 @@ void pokerInit() {
|
||||
// Set up the initial state.
|
||||
// TODO: Should this be randomized?
|
||||
POKER_PLAYER_DEALER = 0;
|
||||
POKER_GAME_POT = 0;
|
||||
|
||||
POKER_GAME_BLINDS_CURRENT = 10;
|
||||
|
||||
// Reset the round state (For the first round)
|
||||
pokerNewRound();
|
||||
@@ -85,4 +91,11 @@ void pokerNewRound() {
|
||||
POKER_PLAYERS[i].hand[j] = POKER_DECK[POKER_DECK_SIZE--];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pokerTakeBlinds() {
|
||||
// TODO: I need to make sure the blind players even have the chips to blind.
|
||||
POKER_PLAYERS[POKER_PLAYER_SMALL_BLIND].chips -= POKER_GAME_BLINDS_CURRENT;
|
||||
POKER_PLAYERS[POKER_PLAYER_BIG_BLIND].chips -= (POKER_GAME_BLINDS_CURRENT*2);
|
||||
POKER_GAME_POT += POKER_GAME_BLINDS_CURRENT * 3;
|
||||
}
|
@@ -22,6 +22,11 @@ extern uint8_t POKER_PLAYER_DEALER;
|
||||
extern uint8_t POKER_PLAYER_SMALL_BLIND;
|
||||
extern uint8_t POKER_PLAYER_BIG_BLIND;
|
||||
|
||||
extern uint16_t POKER_GAME_BLINDS_CURRENT;
|
||||
extern uint16_t POKER_GAME_POT;
|
||||
|
||||
void pokerInit();
|
||||
|
||||
void pokerNewRound();
|
||||
void pokerNewRound();
|
||||
|
||||
void pokerTakeBlinds();
|
Reference in New Issue
Block a user