season.c

来自「利用VC++和OpenGVS结合编的一个关于火车运行的三维模拟程序。是OpenG」· C语言 代码 · 共 63 行

C
63
字号
/******************************************************************************  season.c -- **       Season management (scene changes basically)******************************************************************************/#include <g_sys.h>#include <g_key.h>#include <g_consts.h>#include "train.h"/*************************************************************************** **  season_change**	Called discretely - when it is time to switch from one season*	to another as specified by the caller*****************************************************************************/void season_change( Season newseason ){    static GV_Obi skydome = NULL;    static GV_Obi train_town = NULL;    static GV_Obi summer_time = NULL;    static GV_Obi autumn_time = NULL;    static GV_Obi winter_time = NULL;    /* Save some handles */    if( !train_town )    {        GV_obi_inq_by_name( "TRAIN_TOWN", &train_town );	GV_obi_inq_by_name_relative( train_town, ".../summer", &summer_time);	GV_obi_inq_by_name_relative( train_town, ".../autumn", &autumn_time);	GV_obi_inq_by_name_relative( train_town, ".../winter", &winter_time);        GV_obi_inq_by_name( "SKYDOME", &skydome );    }    /********************** Season control ******************************/    if( newseason == SEASON_SUMMER )    {	GV_obi_set_state( summer_time, G_ON );	GV_obi_set_state( autumn_time, G_OFF );	GV_obi_set_state( winter_time, G_OFF );	GV_obi_set_state( skydome, G_ON );    }    else if( newseason == SEASON_AUTUMN )    {	GV_obi_set_state( summer_time, G_OFF );	GV_obi_set_state( autumn_time, G_ON );	GV_obi_set_state( winter_time, G_OFF );	GV_obi_set_state( skydome, G_OFF );    }    else if( newseason == SEASON_WINTER )    {	GV_obi_set_state( summer_time, G_OFF );	GV_obi_set_state( autumn_time, G_OFF );	GV_obi_set_state( winter_time, G_ON );	GV_obi_set_state( skydome, G_OFF );    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?