📄 game.cpp
字号:
/* main game loop
* Template CS game
* (C)2001 Mat Sutcliffe. See license.txt for license info (GPL)
*/
#include <cssysdef.h>
#include <csutil/objreg.h>
#include <csutil/hashmap.h>
#include <ivideo/graph3d.h>
#include "game.h"
#include "../sound.h"
void Game::start(gamedata_t gamedata) {
playing = 1;
data = gamedata;
// DEV MOD: called when game starts
}
void Game::preframe(csTicks ticks) {
// DEV MOD: called once before every frame, even when game is paused
// you can not use graphics here
}
void Game::doframe(csTicks ticks) {
// DEV MOD: called once every frame, but not when game is paused
}
void Game::postframe(csTicks ticks) {
// DEV MOD: called once after every frame, even when game is paused
}
void Game::stop() {
// DEV MOD: called when game ends
playing = 0;
}
inputcmd_t Game::inputcmds[] = { // DEV MOD: input bindings; see readme.txt
{ "", NULL, false },
{ NULL, NULL, false } // NULL str terminates the list
};
Game::Game(Sound *snd, iObjectRegistry *objreg) {
playing = 0;
// DEV MOD: get interfaces; you shouldn't use objreg during the game
}
const char* Game::init() {
// DEV MOD: do stuff that you wanted to have in the constructor
// but that needs the application to have openned already
// Return NULL if okay, otherwise return error message
return NULL;
}
Game::~Game() {
// DEV MOD: clean up interfaces
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -