⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 globals.h

📁 FC上的超级玛丽C++移植版
💻 H
字号:
/***************************************************************************  globals.h  -  headers for the whole programm, included by every cpp file                             -------------------    copyright            : (C) 2003 by Artur Hallmann, (C) 2003 by FluXy    email                : mail@arturh.com	website				 : http://www.arturh.com ***************************************************************************//*************************************************************************** *                                                                         * *   This program 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; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/ #ifndef __GLOBALS_H__#define __GLOBALS_H__/* *** *** *** *** *** *** *** *** *** *** */#define SCREEN_FLAGS SDL_HWSURFACE | SDL_HWACCEL | SDL_RLEACCEL | SDL_DOUBLEBUF //| SDL_FULLSCREEN#define CAPTION "Super Mario Clone FX"#define VERSION "0.75"
#define LEFT    0#define RIGHT   1#define UP		2#define DOWN	3#define STAYING 0#define WALKING 1#define JUMPING 2#define FALLING 3#define STAY	0#define RUN		2#define FALL	4#define JUMP	6#define MARIO_SMALL 1#define MARIO_BIG 2#define MARIO_SUPER 3#define CAMERASPEED 35 // camerapos in EditMode
//	Console Color Values
#define C_BLACK			0
#define C_DARKBLUE		1
#define C_DARKGREEN		2
#define C_DARKBEIGE		3
#define C_DARKRED		4
#define C_DARKPURPLE	5
#define C_DARKYELLOW	6
#define C_GREY			7
#define C_DARKGREY		8
#define C_BLUE			9
#define C_GREEN			10
#define C_BEIGE			11
#define C_RED			12
#define C_PURPLE		13
#define C_YELLOW		14
#define C_WHITE			15/* *** *** *** *** *** *** *** *** *** *** */
#include <windows.h>#include <iostream>
#include <iostream.h>#include <fstream>#include <string>
#include <time.h>
#include <math.h>
#include <SDL.h>#include <SDL_ttf.h>#include <SDL_image.h>#include <SDL_mixer.h>#ifdef _WIN32#define __WIN32__#endif#ifdef __WIN32__#undef main#endif#ifdef HAVE_CONFIG_H	#include "config.h"#else	#ifdef __WIN32__		#define PIXMAPS_DIR "pixmaps"		#define LEVEL_DIR "levels"
		#define SOUNDS_DIR "data/sounds"
		#define MUSIC_DIR "data/music"	#else		#error HAVE_CONFIG_H is required on non-windows plattforms	#endif#endif#include <stdlib.h>#include <stdio.h>
// ###-Dynamik Link Librarys

#include "..\..\Savegame\Savegame_H.h"
#pragma comment(lib,"Savegame.lib") // Savegame Loading and Saving

// ###

#include "include/Audio.h" // new#include "include/menu.h"#include "include/sprite.h"#include "include/level.h"#include "include/goldpiece.h"#include "include/cloud.h"#include "include/statustext.h"#include "include/levelexit.h"#include "include/powerup.h"#include "include/box.h"#include "include/player.h"#include "include/enemy.h"#include "include/turtle.h"#include "include/goomba.h"
#include "include/jpiranha.h"#include "include/preferences.h"
typedef struct
{	char* szFilename;	SDL_Surface*  pSurface;} Image;extern cSprite **MassiveObjects, **PassiveObjects, **ActiveObjects, **EnemyObjects, **HUDObjects;extern int MassiveCount, PassiveCount, ActiveCount, EnemyCount, HUDCount;extern bool done;extern SDL_Surface *screen, *screen2, *Position_info;extern cPunktestand *ps;extern cDebugAnzeige *debugdisplay;extern cGoldDisplay *golddisplay;extern cLifeDisplay *lifedisplay;extern cSpielzeitAnzeige *timedisplay;extern char** levels;extern int LevelCount;extern Uint32 magenta, bgcolor,std_bgcolor , darkblue, white, grey, green;extern TTF_Font *font, *font_16;extern SDL_Color colorBlack, colorWhite, colorBlue, colorDarkblue, colorGreen;extern cPlayer *pPlayer;extern cLevel *pLevel;extern cMainMenu *pMenu;extern Uint8 *keys;extern SDL_Event event;
// ### Joystick
extern bool MKey_Jump,MKey_Up,MKey_Down,MKey_Left,MKey_Right,MKey_Shoot; // Joypad Keys
extern int Joy_cur_stick;
extern SDL_Joystick *Joy_stick;
extern int Joy_Threshold;
// ###
extern bool Joy_Debug,Joy_No_Stick_Opened;extern bool EditMode;extern signed int cameraposx;extern signed int cameraposy;extern signed int _cameraposx;extern signed int _cameraposy;extern Image* ImageDB;extern int iImageCount;extern int UpKeyTime;extern cSprite* MouseObject;
extern cSprite* CopyObject;extern cMouseCursor* MouseCursor;extern bool MousePressed;
extern int mouse_W,mouse_H;extern int mouseX, mouseY, _mouseX, _mouseY;
// ### Preferences
extern cPreferences *pPreferences;
// ###extern unsigned int fps;
extern cAudio *pAudio; // new
void AddObject ( cSprite** Array, int* ArrayCount, cSprite* obj );void AddActiveObject ( cSprite* obj );void AddPassiveObject ( cSprite* obj );void AddEnemyObject ( cSprite* obj );void AddHUDObject ( cSprite* obj );void AddMassiveObject ( cSprite* obj );SDL_Surface *LoadImage(const char *filename);void MoveObject ( cSprite** FromArray , int *FromArrayCount , int FromArrayIndex , cSprite** ToArray , int *ToArrayCount );SDL_Surface* MakeSurface(int width, int height, int format);void AddImage(char* szFilename, SDL_Surface* pSurface);SDL_Surface* GetImage(char* szFilename);void ReloadSurfaces();SDL_Surface *LoadImage(const char *filename);SDL_Surface* MakeSurface(int width, int height, int format);int ChooseMenu ( int ,std :: string**, std :: string ,Uint8 Col_red = 0,Uint8 Col_green = 0,Uint8 Col_blue = 110);//void GetText(char* text, SDL_Surface* surface, Uint32* background);
void Set_Console_Color(int TextColor, int BackColor = C_BLACK);
char *Get_Curr_Time(void);int OpenFile(char *szFile);

#endif

⌨️ 快捷键说明

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