ftp.nice.ch/pub/next/games/action/NeXThextris.1.0.s.tar.gz#/hextris/nextio.m

This is nextio.m in view mode; [Download] [Up]

/*
 * NeXThextris Copyright 1994 Mark Gritter, mgritter@gac.edu
 *
 * hextris Copyright 1990 David Markley, dm3e@+andrew.cmu.edu, dam@cs.cmu.edu
 *
 * Permission to use, copy, modify, and distribute, this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of the copyright holders be used in
 * advertising or publicity pertaining to distribution of the software with
 * specific, written prior permission, and that no fee is charged for further
 * distribution of this software, or any modifications thereof.  The copyright
 * holder make no representations about the suitability of this software for
 * any purpose.  It is provided "as is" without express or implied warranty.
 *
 * THE COPYRIGHT HOLDER DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/* This file contains the I/O handling routines for hextris.
 * Originally xio.c, modified for NeXTstep.  Most of the "guts" are elsewhere.
 */

#include "header.h"
#include "hextris.h"
#import "HextrisControl.h"
#import "HextrisView.h"
#import <appkit/Application.h>

id display, controller;

/* This is required by hextris!
 *
 * This clears the window.
 */
void clear_display()
{
    [display clear];
}

/* This is required by hextris!
 *
 * This displays the current score and rows completed.
 */
void display_scores(int *score, int *rows) {
    [controller showScores];
}

/* This is required by hextris!
 *
 * This displays the help information.
 */
void display_help(void)
{
	[controller showHelp];
}

/* This is required by hextris!
 *
 * This displays the high score list.
 */
void display_high_scores(high_score_t high_scores[MAXHIGHSCORES])
{
	[controller showHighScores:controller];
}

/* This is required by hextris!
 *
 * This displays the next piece to be dropped.
 */
void show_next_piece(piece_t *npiece) {
	piece_t piece;
	piece.type = npiece->type;
    piece.rotation = npiece->rotation;
    piece.row = 1;
    piece.column = 1;
	[controller showNextPiece:&piece];
}

/* This is required by hextris!
 *
 * This draws one hex at the specified row and column specified.
 */
void draw_hex(int row, int column, int fill, int type)
{
	[display drawHexAt:row:column:fill:type];
}

/* This is required by hextris!
 *
 * This ends the game by closing everything down and exiting.
 */
void end_game()
{
	[NXApp terminate:controller];
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.