mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
catch franklin up with recent API changes
This commit is contained in:
parent
bda6841a8f
commit
657454aa6c
7 changed files with 42 additions and 34 deletions
|
@ -131,7 +131,13 @@ game_reset( MPFORMAL XWGame* game, CurGameInfo* gi, XW_UtilCtxt* util,
|
|||
#endif
|
||||
|
||||
model_init( game->model, gi->boardSize, gi->boardSize );
|
||||
server_reset( game->server, game->comms );
|
||||
server_reset( game->server,
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
game->comms
|
||||
#else
|
||||
NULL
|
||||
#endif
|
||||
);
|
||||
board_reset( game->board );
|
||||
|
||||
for ( i = 0; i < gi->nPlayers; ++i ) {
|
||||
|
|
|
@ -47,5 +47,7 @@ enum {
|
|||
STR_PASSED,
|
||||
STR_LOSTTURN,
|
||||
|
||||
STRS_VALUES_HEADER,
|
||||
|
||||
STR_LAST
|
||||
};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- mode: Makefile; compile-command: "make -k ARCH=i686"; -*-
|
||||
# ©2001 Franklin Electronic Publishers, Inc. Burlington, NJ.
|
||||
# File: gui/test/Makefile
|
||||
#
|
||||
|
@ -51,11 +52,11 @@ OBJS = ${COMMONOBJ}
|
|||
|
||||
# Include the standard Makefile targets
|
||||
ifeq (x$(EBSDK_LIBS)x,xx)
|
||||
# Normal: binary release version
|
||||
# Normal: binary release version
|
||||
include ${EBOOKMAN_SDK}/ebsdk.uses
|
||||
include ${ESDK_TARGET_INC}/Makefile.GUI
|
||||
else
|
||||
# Special: building the SDK
|
||||
# Special: building the SDK
|
||||
include ${EBSDK_LIBS}/ebookman_libs.uses
|
||||
include ../source/Makefile.GUI
|
||||
endif
|
||||
|
@ -78,7 +79,7 @@ endif
|
|||
#Need this for an os1 link of a program that uses floating-point
|
||||
#GCC_LIB = ${ESDK_LIBGCC_INSTALL_LIBFILE_FLOAT}
|
||||
|
||||
INCFLAGS += -I$(COMMON) -I./
|
||||
INCFLAGS += -I$(COMMON) -I../relay -I./
|
||||
CFLAGS += ${XW_DEFINES} -DCPLUS
|
||||
CFL_NOCPLUS = $(subst -DCPLUS,,${CFLAGS})
|
||||
|
||||
|
|
|
@ -269,7 +269,8 @@ frank_draw_clearRect( DrawCtx* p_dctx, XP_Rect* rectP )
|
|||
|
||||
static void
|
||||
frank_draw_drawBoardArrow( DrawCtx* p_dctx, XP_Rect* xprect,
|
||||
XWBonusType cursorBonus, XP_Bool vertical )
|
||||
XWBonusType cursorBonus, XP_Bool vertical,
|
||||
HintAtts hintAtts )
|
||||
{
|
||||
FrankDrawCtx* dctx = (FrankDrawCtx*)p_dctx;
|
||||
RECT rect;
|
||||
|
@ -341,8 +342,8 @@ scoreWidthAndText( char* buf, const FONT* font, DrawScoreInfo* dsi )
|
|||
|
||||
static void
|
||||
frank_draw_measureScoreText( DrawCtx* p_dctx, XP_Rect* r,
|
||||
DrawScoreInfo* dsi,
|
||||
XP_U16* width, XP_U16* height )
|
||||
DrawScoreInfo* dsi,
|
||||
XP_U16* width, XP_U16* height )
|
||||
{
|
||||
FrankDrawCtx* dctx = (FrankDrawCtx*)p_dctx;
|
||||
char buf[20];
|
||||
|
@ -354,9 +355,8 @@ frank_draw_measureScoreText( DrawCtx* p_dctx, XP_Rect* r,
|
|||
|
||||
static void
|
||||
frank_draw_score_drawPlayer( DrawCtx* p_dctx,
|
||||
XP_S16 playerNum, /* -1: don't use */
|
||||
XP_Rect* rInner, XP_Rect* rOuter,
|
||||
DrawScoreInfo* dsi )
|
||||
XP_Rect* rInner, XP_Rect* rOuter,
|
||||
DrawScoreInfo* dsi )
|
||||
{
|
||||
FrankDrawCtx* dctx = (FrankDrawCtx*)p_dctx;
|
||||
char buf[20];
|
||||
|
@ -372,7 +372,7 @@ frank_draw_score_drawPlayer( DrawCtx* p_dctx,
|
|||
|
||||
static void
|
||||
frank_draw_score_pendingScore( DrawCtx* p_dctx, XP_Rect* rect, XP_S16 score,
|
||||
XP_U16 playerNum )
|
||||
XP_U16 playerNum )
|
||||
{
|
||||
FrankDrawCtx* dctx = (FrankDrawCtx*)p_dctx;
|
||||
char buf[5];
|
||||
|
|
|
@ -39,16 +39,16 @@ extern "C" {
|
|||
|
||||
class LettersList : public CList {
|
||||
private:
|
||||
XP_UCHAR4* fTexts;
|
||||
const XP_UCHAR4* fTexts;
|
||||
|
||||
public:
|
||||
LettersList( XP_UCHAR4* texts, U16 numRows );
|
||||
LettersList( const XP_UCHAR4* texts, U16 numRows );
|
||||
|
||||
U16 GetRowHeight( S32 row ) { return LETTER_HEIGHT; }
|
||||
void DrawRow( RECT *rect, S32 row );
|
||||
};
|
||||
|
||||
LettersList::LettersList( XP_UCHAR4* texts, U16 numRows )
|
||||
LettersList::LettersList( const XP_UCHAR4* texts, U16 numRows )
|
||||
: CList( 1001, LETTERS_ROW_WIDTH,
|
||||
LETTERS_ROW_HEIGHT * LETTERS_NUM_VISROWS,
|
||||
numRows, LISTOPTION_ALWAYS_HIGHLIGHT )
|
||||
|
@ -64,8 +64,8 @@ void LettersList::DrawRow( RECT *rect, S32 row )
|
|||
window->DrawText( (char*)fTexts[row], rect->x, rect->y );
|
||||
} /* LettersList::DrawRow */
|
||||
|
||||
CAskLetterWindow::CAskLetterWindow( PickInfo* pi, XP_U16 playerNum,
|
||||
XP_UCHAR4* texts, XP_U16 nTiles,
|
||||
CAskLetterWindow::CAskLetterWindow( const PickInfo* pi, XP_U16 playerNum,
|
||||
const XP_UCHAR4* texts, XP_U16 nTiles,
|
||||
XP_S16* resultP )
|
||||
: CWindow( ASKLETTER_WINDOW_ID, 55, 15, 80, 220, "Blank", TRUE )
|
||||
{
|
||||
|
|
|
@ -24,12 +24,12 @@ extern "C" {
|
|||
|
||||
class CAskLetterWindow : public CWindow {
|
||||
private:
|
||||
XP_UCHAR4* fTexts;
|
||||
const XP_UCHAR4* fTexts;
|
||||
XP_S16* fResultP;
|
||||
XP_U16 fNTiles;
|
||||
CList* list; /* my own subclass, of course */
|
||||
public:
|
||||
CAskLetterWindow( PickInfo* pi, XP_U16 playerNum,
|
||||
XP_UCHAR4* texts, XP_U16 nTiles, XP_S16* result );
|
||||
CAskLetterWindow( const PickInfo* pi, XP_U16 playerNum,
|
||||
const XP_UCHAR4* texts, XP_U16 nTiles, XP_S16* result );
|
||||
S32 MsgHandler( MSG_TYPE type, CViewable *object, S32 data );
|
||||
};
|
||||
|
|
|
@ -91,9 +91,9 @@ static DictionaryCtxt* frank_util_makeEmptyDict( XW_UtilCtxt* uc );
|
|||
static void frank_util_userError( XW_UtilCtxt* uc, UtilErrID id );
|
||||
static XP_Bool frank_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id,
|
||||
XWStreamCtxt* stream );
|
||||
static XP_S16 frank_util_userPickTile( XW_UtilCtxt* uc, PickInfo* pi,
|
||||
static XP_S16 frank_util_userPickTile( XW_UtilCtxt* uc, const PickInfo* pi,
|
||||
XP_U16 playerNum,
|
||||
XP_UCHAR4* texts, XP_U16 nTiles );
|
||||
const XP_UCHAR4* texts, XP_U16 nTiles );
|
||||
static XP_Bool frank_util_askPassword( XW_UtilCtxt* uc, const XP_UCHAR* name,
|
||||
XP_UCHAR* buf, XP_U16* len );
|
||||
static void frank_util_trayHiddenChange( XW_UtilCtxt* uc,
|
||||
|
@ -303,7 +303,7 @@ CXWordsWindow::CXWordsWindow(MPFORMAL FrankDictList* dlist )
|
|||
|
||||
/* there needs to be a "game" for the saved one to be loaded into. */
|
||||
game_makeNewGame( MPPARM(mpool) &fGame, &fGameInfo, &this->util,
|
||||
(DrawCtx*)this->draw, &this->cp,
|
||||
(DrawCtx*)this->draw, 0, &this->cp,
|
||||
(TransportSend)NULL, NULL);
|
||||
loadCurrentGame();
|
||||
|
||||
|
@ -363,14 +363,14 @@ CXWordsWindow::positionBoard()
|
|||
void
|
||||
CXWordsWindow::makeNewGame( U16 newIndex )
|
||||
{
|
||||
XP_U32 gameID = frank_util_getCurSeconds( &this->util );
|
||||
if ( !!fGame.model ) {
|
||||
saveCurrentGame();
|
||||
XP_U32 gameID = frank_util_getCurSeconds( &this->util );
|
||||
game_reset( MEMPOOL(this) &fGame, &fGameInfo, gameID, &this->cp,
|
||||
(TransportSend)NULL, NULL );
|
||||
game_reset( MEMPOOL(this) &fGame, &fGameInfo, &this->util,
|
||||
gameID, &this->cp, (TransportSend)NULL, NULL );
|
||||
} else {
|
||||
game_makeNewGame( MPPARM(mpool) &fGame, &fGameInfo, &this->util,
|
||||
(DrawCtx*)this->draw, &this->cp,
|
||||
(DrawCtx*)this->draw, gameID, &this->cp,
|
||||
(TransportSend)NULL, NULL);
|
||||
positionBoard();
|
||||
}
|
||||
|
@ -746,11 +746,8 @@ CXWordsWindow::newGame( XP_Bool allowCancel )
|
|||
XP_ASSERT( allowCancel || !cancelled ); /* can't clear cancelled if not
|
||||
allowed to */
|
||||
if ( !cancelled ) {
|
||||
#if 0
|
||||
makeNewGame( this->gamesDB->countRecords() );
|
||||
#else
|
||||
XP_U32 gameID = frank_util_getCurSeconds( &this->util );
|
||||
game_reset( MPPARM(mpool) &fGame, &fGameInfo, gameID,
|
||||
game_reset( MPPARM(mpool) &fGame, &fGameInfo, &this->util, gameID,
|
||||
&this->cp, (TransportSend)NULL, NULL );
|
||||
if ( !!fGameInfo.dictName ) {
|
||||
DictionaryCtxt* dict = model_getDictionary( fGame.model );
|
||||
|
@ -766,7 +763,6 @@ CXWordsWindow::newGame( XP_Bool allowCancel )
|
|||
model_setDictionary( fGame.model, dict );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
server_do( fGame.server );
|
||||
|
||||
GUI_NeedUpdate();
|
||||
|
@ -1122,7 +1118,7 @@ CXWordsWindow::doTileValues()
|
|||
XWStreamCtxt* stream;
|
||||
|
||||
stream = makeMemStream();
|
||||
server_formatPoolCounts( fGame.server, stream, 2 /* cols */ );
|
||||
server_formatDictCounts( fGame.server, stream, 2 /* cols */ );
|
||||
|
||||
displayTextFromStream( stream, "Tile counts and values" );
|
||||
} /* doTileValues */
|
||||
|
@ -1406,9 +1402,9 @@ frank_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, XWStreamCtxt* stream )
|
|||
} /* frank_util_userQuery */
|
||||
|
||||
static XP_S16
|
||||
frank_util_userPickTile( XW_UtilCtxt* uc, PickInfo* pi,
|
||||
frank_util_userPickTile( XW_UtilCtxt* uc, const PickInfo* pi,
|
||||
XP_U16 playerNum,
|
||||
XP_UCHAR4* texts, XP_U16 nTiles )
|
||||
const XP_UCHAR4* texts, XP_U16 nTiles )
|
||||
{
|
||||
CXWordsWindow* self = (CXWordsWindow*)uc->closure;
|
||||
XP_S16 result;
|
||||
|
@ -1587,6 +1583,9 @@ frank_util_getUserString( XW_UtilCtxt* uc, XP_U16 stringCode )
|
|||
case STR_LOSTTURN:
|
||||
return (XP_UCHAR*)"Lost turn";
|
||||
|
||||
case STRS_VALUES_HEADER:
|
||||
return (XP_UCHAR*)"%s counts/values:\n";
|
||||
|
||||
default:
|
||||
return (XP_UCHAR*)"unknown code ";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue