Exemplo n.º 1
0
int my_list_proc( int msg, DIALOG* d, int c )
{
    STACKTRACE;
    int old_d1 = d->d1;
    Fleet *fleet = (Fleet*)d->dp3;
    int ret = d_list_proc2( msg, d, c );
    if ( d->d1 != old_d1 || msg == MSG_START ) {
        ShipType* type = fleet->getShipType(d->d1);

        ASSERT(type != NULL);

        selectDialog[SELECT_DIALOG_TITLE].flags |= D_DIRTY;
        sprintf(selectTitleString, "%s\n%s\n%d of %d points",
                selectShipPrompt,
                (type != NULL) ? type->name : 0,
                (type != NULL) ? type->cost : 0,
                fleet->getCost());

        BITMAP* panel = NULL;
        TW_DATAFILE* data = tw_load_datafile_object( type->data->file, "SHIP_P00_PCX" );

        if ( data ) {
            BITMAP* bmp = (BITMAP*)data->dat;
            panel = create_bitmap_ex( bitmap_color_depth(screen), bmp->w, bmp->h );
            blit( bmp, panel, 0, 0, 0, 0, bmp->w, bmp->h );
            tw_unload_datafile_object( data );
            data = tw_load_datafile_object( type->data->file, "SHIP_P01_PCX" );
            bmp = (BITMAP*)data->dat;
            blit( bmp, panel, 0, 0, 4, 65, bmp->w, bmp->h );
            tw_unload_datafile_object( data );
            color_correct_bitmap( panel, 0 );
        }

        if ( selectDialog[SELECT_DIALOG_PIC].dp ) destroy_bitmap( (BITMAP*)selectDialog[SELECT_DIALOG_PIC].dp );
        selectDialog[SELECT_DIALOG_PIC].dp = panel;
        scare_mouse();
        SEND_MESSAGE( &selectDialog[SELECT_DIALOG_PIC], MSG_DRAW, 0 );
        unscare_mouse();
    }
    return ret;
}
Exemplo n.º 2
0
void NormalGame::display_stats()
{
	STACKTRACE;
	pause();
	int i;
	for (i = 0; i < num_players; i += 1) {
		Fleet *fleet = player_fleet[i];
		switch (log->type) {
			case Log::log_net1client:
			case Log::log_net1server:
			{
				//				if (log->get_direction(player_control[i]->channel) & Log::direction_write)
				message.print(6000, 15, "%s status: : %d / ?? Ships, %d / ??? points", player_name[i], fleet->getSize(), fleet->getCost());
				//				else
				//					message.print(6000, 15, "%s status: : %d / %d points", buffy, fleet->cost, player_total_fleet[i]);
			}
			break;
			default:
			{
				message.print(6000, 15, "%s status: : %d / ?? Ships, %d / ??? points", player_name[i], fleet->getSize(), fleet->getCost());
			}
			break;
		}
	}
	unpause();
	return;
}