Prepared triggers.

This commit is contained in:
johns 2002-03-02 03:16:54 +00:00
parent 2d324366bb
commit ec441e62f3
5 changed files with 130 additions and 4 deletions

View file

@ -30,7 +30,7 @@ include $(TOPDIR)/$(RULESFILE)
MODULE = game
SRCS = campaign.c intro.c game.c savegame.c loadgame.c
SRCS = campaign.c trigger.c intro.c game.c savegame.c loadgame.c
OBJS = $(addprefix $(OBJDIR), $(SRCS:.c=.$(OE)))

75
src/game/trigger.cpp Normal file
View file

@ -0,0 +1,75 @@
// ___________ _________ _____ __
// \_ _____/______ ____ ____ \_ ___ \____________ _/ ____\/ |_
// | __) \_ __ \_/ __ \_/ __ \/ \ \/\_ __ \__ \\ __\\ __\
// | \ | | \/\ ___/\ ___/\ \____| | \// __ \| | | |
// \___ / |__| \___ >\___ >\______ /|__| (____ /__| |__|
// \/ \/ \/ \/ \/
// ______________________ ______________________
// T H E W A R B E G I N S
// FreeCraft - A free fantasy real time strategy game engine
//
/**@name trigger.c - The trigger handling. */
//
// (c) Copyright 2002 by Lutz Sammer
//
// FreeCraft is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
// by the Free Software Foundation; only version 2 of the License.
//
// FreeCraft is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// $Id$
//@{
/*----------------------------------------------------------------------------
-- Includes
----------------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freecraft.h"
#include "trigger.h"
/*----------------------------------------------------------------------------
-- Declarations
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
-- Functions
----------------------------------------------------------------------------*/
/**
** Register CCL features for triggers.
*/
global void TriggerCclRegister(void)
{
}
/**
** Save the trigger module.
*/
global void SaveTrigger(FILE* file)
{
fprintf(file,"\n;;; -----------------------------------------\n");
fprintf(file,";;; MODULE: trigger $Id$\n\n");
fprintf(file,";;; FIXME: Save not written\n\n");
}
/**
** Clean up the trigger module.
*/
global void CleanTrigger(void)
{
DebugLevel0Fn("FIXME: Cleaning trigger not written\n");
}
//@}

View file

@ -43,7 +43,7 @@ HDRS = actions.h ai.h ccl.h freecraft.h construct.h cursor.h font.h icons.h \
ccl_sound.h sound.h sound_id.h unitsound.h wav.h sound_server.h \
video.h network.h commands.h goal.h ui.h menus.h spells.h \
siod.h siodp.h iolib.h depend.h settings.h myendian.h net_lowlevel.h \
netconnect.h rdtsc.h campaign.h \
netconnect.h rdtsc.h campaign.h trigger.h \
etlib/generic.h etlib/xmalloc.h etlib/hash.h etlib/dllist.h \
all:

View file

@ -48,8 +48,8 @@ enum _game_goal_ {
-- Functions
----------------------------------------------------------------------------*/
global void SetGlobalGoal(int goal); /// set global game goal
global void CheckGoals(void); /// test if goals reached
extern void SetGlobalGoal(int goal); /// set global game goal
extern void CheckGoals(void); /// test if goals reached
//@}

51
src/include/trigger.h Normal file
View file

@ -0,0 +1,51 @@
// ___________ _________ _____ __
// \_ _____/______ ____ ____ \_ ___ \____________ _/ ____\/ |_
// | __) \_ __ \_/ __ \_/ __ \/ \ \/\_ __ \__ \\ __\\ __\
// | \ | | \/\ ___/\ ___/\ \____| | \// __ \| | | |
// \___ / |__| \___ >\___ >\______ /|__| (____ /__| |__|
// \/ \/ \/ \/ \/
// ______________________ ______________________
// T H E W A R B E G I N S
// FreeCraft - A free fantasy real time strategy game engine
//
/**@name trigger.h - The game trigger headerfile. */
//
// (c) Copyright 2002 by Lutz Sammer
//
// FreeCraft is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
// by the Free Software Foundation; only version 2 of the License.
//
// FreeCraft is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// $Id$
#ifndef __TRIGGER_H__
#define __TRIGGER_H__
//@{
/*----------------------------------------------------------------------------
-- Declarations
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
-- Variables
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
-- Functions
----------------------------------------------------------------------------*/
extern void CheckTriggers(void); /// test all triggers
extern void TriggerCclRegister(void); /// Register ccl features
extern void SaveTrigger(FILE*); /// Save the trigger module
extern void CleanTrigger(void); /// Cleanup the trigger module
//@}
#endif // !__TRIGGER_H__