code
stringlengths
1
2.06M
language
stringclasses
1 value
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MP...
C++
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MP...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * t...
C++
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MP...
C++
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MP...
C++
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MP...
C++
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MP...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the Lic...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the Lic...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the Lic...
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the Lic...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the Lic...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the Lic...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * t...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * t...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * t...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the Lic...
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the Lic...
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the Lic...
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the Lic...
C++
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MP...
C++
[Files] Source: {#xbasepath}\Release\npffax.dll; DestDir: {app}; DestName: npffax.dll; Flags: overwritereadonly restartreplace uninsrestartdelete [Registry] Root: HKLM32; Subkey: SOFTWARE\MozillaPlugins\@itstructures.com/ffactivex; Flags: uninsdeletekey Root: HKLM32; Subkey: SOFTWARE\MozillaPlugins\@itstructures....
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2010 Trevor Hogan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Trevor Hogan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Trevor Hogan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2010 Trevor Hogan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2010 Trevor Hogan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2011 Gene Chen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
C++
/* Copyright 2010 Trevor Hogan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
C++
#include "gamerequester.h" #include "gameprotocol.h" #include "commandpacket.h" GameRequester::GameRequester(QWidget* parent) : QObject(parent) { socket = new QUdpSocket(this); socket->bind(6969, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint); connect(socket, SIGNAL(readyRead()), this, SLOT(readPendingD...
C++
#include <vector> #include <stdio.h> #include "json.h" void populate_sources(const char *filter, std::vector<std::vector<char> > &sources) { char filename[256]; for (int i = 1; i < 64; ++i) { sprintf(filename, filter, i); FILE *fp = fopen(filename, "rb"); if (fp) { fseek(fp, 0, SEEK_END); ...
C++
#include <memory.h> #include "json.h" // true if character represent a digit #define IS_DIGIT(c) (c >= '0' && c <= '9') // convert string to integer char *atoi(char *first, char *last, int *out) { int sign = 1; if (first != last) { if (*first == '-') { sign = -1; ++first; } else if (...
C++
#ifndef BLOCK_ALLOCATOR_H #define BLOCK_ALLOCATOR_H class block_allocator { private: struct block { size_t size; size_t used; char *buffer; block *next; }; block *m_head; size_t m_blocksize; block_allocator(const block_allocator &); block_allocator &operator=(block_allocator &); p...
C++
#include <memory.h> #include <algorithm> #include "block_allocator.h" block_allocator::block_allocator(size_t blocksize): m_head(0), m_blocksize(blocksize) { } block_allocator::~block_allocator() { while (m_head) { block *temp = m_head->next; ::free(m_head); m_head = temp; } } void block_a...
C++
/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
C++
char sample[] = { "=== ALL USERS PLEASE NOTE ========================\n" "\n" "CAR and CDR now return extra values.\n" "\n" "The function CAR now returns two values. Since it has to go to the\n" "trouble to figure out if the object is carcdr-able anyway, we figured\n" "you might as well get both halves...
C++
#pragma once #include "Graphics_Lib.h" #include "HelpfulData.h" class Line { private: Texture * m_tex; V2DF m_start; V2DF m_end; float m_length; float m_angle; int m_numSprites; RECT m_lastSprite; int m_spriteHeight; int m_spriteWidth; void calculate(); public: Line(); ~Line(); void re...
C++
#include "Enemy.h" Enemy::Enemy() { State = Wander; } void Enemy::update() { switch(State) { case Wander: break; case Chase: break; case Attack: break; case Advanced_Attack: break; case Flank: break; default: break; } }
C++
#pragma once #include "HelpfulData.h" #include "Animation.h" class Skills { private: ClDwn cldwn; int lvlReq; int str; Animation playerAnimation; public: void use(); };
C++
#include "Floor.h" // default constructor Floor::Floor() {} // default deconstructor, make sure release is called Floor::~Floor() { release(); } // release all data safetly void Floor::release() { } // setup floor void Floor::intialize(char * fileName) { // setup a default test room for(int y = 0...
C++
#pragma once #include "Graphics_Lib.h" #include "HelpfulData.h" class Tile { private: SpriteSheet m_tex; FRect m_bounds; int m_tileType; public: V2DF m_position; Tile(); ~Tile(); void initialize(V2DF pos, int tileType); void release(); void render(); void update(float dT); FRect getBounds(...
C++
#include "Input.h" // Return a reference to the input device Input::Input() { // set devices to null m_pDInput = 0; m_pKeyboard = 0; m_pMouse = 0; } Input* Input::getInstance() { static Input instance; return &instance; } Input::~Input() { release(); } void Input::initialize(HINSTANCE h...
C++
#include "World.h" // default constructor World::World() {} // default destructor, make sure release is called World::~World() { release(); } // safetly release all data void World::release() { } // setup the world void World::initialize() { m_currentFloor = 0; // setup every floor for(int i = ...
C++
#pragma once #include "Entity.h" #include "v2d.h" #include "templatevector.h" extern class Player; enum ENEMY_TYPE {BASIC_ENEMY, RANGED_ENEMY, STRONG_ENEMY}; class Enemy : public Entity { Player * target; int Attack_force; TemplateVector<GraphNode*> Math; GraphNode * node; bool See_Player;...
C++
#pragma once #include "HelpfulData.h" #include "Input.h" #include "Entity.h" class Player : public Entity { private: //TemplateVector<Item> inventory; ClDwn invincible; int level; int experience; //Item* activeItem; float speed; int score; /* Input */ Input* pInput; public: Player(void)...
C++
#pragma once #include "HelpfulData.h" class GraphNode; // used to easily store connections struct Connection { GraphNode* neighbor; float cost; }; class GraphNode { public: // all connections this node has TemplateVector<Connection> m_neighbors; // position in world space V2DF m_position; pu...
C++
#include "Sound.h" void Sound::initialize() { //////////////////////////////////////////////////////////////////////////// // Set up FMOD and sounds /////////////////////////////////////////////////////////////////////////// // create system FMOD::System_Create(&system); // get version system->getVers...
C++
#include "HelpfulData.h" void seedRand() { srand(time(NULL)); } bool colliding(FRect r1, FRect r2) { // check veritcal first if( (r1.top > r2.top && r1.top < r2.bottom) || (r1.bottom > r2.top && r1.bottom < r2.bottom) ) { // check horizantally if( (r1.left > r2.left && r1.left < r2.right) ...
C++
#include "DX2DEngine.h" #include "Texture.h" #include <string.h> #include <stdlib.h> // make all pointers zero DX2DEngine::DX2DEngine() { m_pD3DObject = 0; m_pD3DDevice = 0; m_pSprite = 0; m_bVsync = false; fps = 0; frameCount = 0; elapsedTime = 0.0; } // make sure the release is called DX...
C++
#include "Item.h" #include "Player.h"
C++
#include "Entity.h" Entity::Entity() { stats.health = 0; stats.str = 0; stats.tough = 0; stats.agil = 0; stats. weight = 0; rotation = 0.0f; dead = false; } Entity::~Entity() {} void Entity::takeDamage(int amount) { stats.health -= amount/(amount+stats.tough); if(stats.health <= 0) dead...
C++
#pragma once #include "DX2DEngine.h" #include "v2d.h" #include "HelpfulData.h" enum Texture_Type {BASIC, SHEET, ANIMATION}; // Basic 2D Sprite object // contains the necessary information to store for a single d3d texture // ...and draw it to the screen class Texture { protected: // graphics engine refe...
C++
#include "GameEngine.h" #include "HelpfulData.h" GameEngine::GameEngine() { } // Make sure release is called GameEngine::~GameEngine() { release(); } // set up all game components void GameEngine::initialize() { // get sound engine reference pSound = Sound::getInstance(); // set camera move s...
C++
#pragma once #include "templatearray.h" /** * simple templated vector. Ideal for dynamic lists of primitive types and single pointers. * @WARNING template with virtual types, or types that will be pointed to at your own risk! * in those situations, templates of pointers to those types are a much better idea...
C++
#include "Animation.h" // basic constructor Animation::Animation() { m_index = 0; m_playing = false; } // make sure safer release is called Animation::~Animation() {} // setup the animation based on the appopriate spritesheet values void Animation::initialize(LPCWSTR fileName, int count, int numRows,...
C++
#pragma once #include "HelpfulData.h" #include "Texture.h" extern class Item; // used as return type for collision function // NONE = no collision occured // MAIN = only the main rect was collided with or only the main rect was checked // RIGHT, LEFT, TOP, BOT = corresponding side was collided enum SIDE {NON...
C++
#pragma once /** * a simple HashMap data structure, using TemplateVectors of KeyValuePairs as * buckets. The hash size is DEFAULT_BUCKET_SIZE, or 32. The hashFunction * values between 0 and 31 by bitshifting and masking */ template <class KEY, class VALUE> class TemplateHashMap { struct KeyValuePair ...
C++
#pragma once #include <math.h> // drawing and math methods that require the libraries above #define V2D_SIN sin #define V2D_COS cos // modify this if changing V2D's data types #define V2D_GLVERTEX_METHOD glVertex2fv // PI defined to reduce dependency on other math libraries #define V2D_PI (3.141592653...
C++
#include "Graph.h" // default constructor Graph::Graph() {} // default destructor // :make sure safer release is called Graph::~Graph() { release(); } // safetly release all data void Graph::release() { // release the adjacency matrix for(int i = 0; i < m_size; ++i) { delete [] m_AdjacencyMatrix[...
C++
#pragma once #include "Texture.h" #include "Animation.h" #include "HelpfulData.h" #include "Entity.h" enum WeaponType { FISTS, MANUAL, BAT, AIRPLANE, STAPLEGUN, SPRAY, NAILGUN } ; class Item { private: enum Type {CURRENCY, WEAPON, MISC, AMMO}; Type itemType ; int amount ; public: Item( ) {} /...
C++
#include "Tile.h" // default constructor Tile::Tile() {} // default destructor make sure release is called Tile::~Tile() { release(); } // safetly release all data void Tile::release() { m_tex.release(); } // setup tile of given type void Tile::initialize(V2DF pos, int tileType) { // load texture...
C++
#pragma once /** ideal when the size is known at creation time */ template<typename DATA_TYPE> class TemplateArray { protected: /** pointer to the allocated data for the vector */ DATA_TYPE * m_data; /** actual number of allocated elements that we can use */ int m_allocated; public: /** @return valu...
C++
#pragma once #include "Sound.h" #include "Input.h" #include "Graphics_Lib.h" #include "Entity.h" #include "Player.h" #include "World.h" enum G_State {MENU, CLASS, GAME, DEAD, VICTORY}; // contains all game components class GameEngine { private: bool running; G_State m_state; // audio Sound* pSo...
C++
// // This header file is full of usual unversal functions, structs, classes and other includes // #pragma once #include <math.h> #include <time.h> #include <stdlib.h> #include <Windows.h> #include "templatearray.h" #include "templatevector.h" #include "v2d.h" #include <stdio.h> //#include <vld.h> #inclu...
C++
#pragma once #include "SpriteSheet.h" #include "HelpfulData.h" class Animation : public SpriteSheet { private: ClDwn m_frameSwitch; bool m_playing; bool m_loop; public: Animation(); ~Animation(); void initialize(LPCWSTR fileName, int count, int numRows, int numColumns, int spriteWidth, int spriteHei...
C++
#include "Texture.h" // default constructor setting initial values to 0 Texture::Texture() { // set view rect to default m_viewRect.right = m_viewRect.left = m_viewRect.bottom = m_viewRect.top = -1; // set pointers to null engine = 0; } // make sure that safe release is called Texture::~Texture() { ...
C++
#pragma once ////////////////////////////////////////////////////////////////////////// // FMOD ////////////////////////////////////////////////////////////////////////// #include <fmod.h> #include <fmod.hpp> #pragma comment(lib, "Fmodex_vc.lib") #define HIT 0 #define PRESS 1 #define FIRE 2 class Sound {...
C++
#include "SpriteSheet.h" SpriteSheet::SpriteSheet() {} // make sure safer release is called SpriteSheet::~SpriteSheet() { release(); } // safetly release all data void SpriteSheet::release() { m_rects.release(); } // setup the texture and rects for the sprite sheet // numColumns : number of columns i...
C++
#pragma once #include "Player.h" Player::Player() { tex.initialize(L"\images\test.png",true); stats.str = 0; stats.health = 0; stats.tough = 0; stats.agil = 0; stats.weight = 0; orientation = NORTH; speed = 300.0f; pInput = Input::getInstance(); } Player::~Player() { pInput->release(); } ...
C++
#pragma once #include "Graphics_Lib.h" #include "HelpfulData.h" #include "Floor.h" extern class Entity; extern class GraphNode; #define NUM_FLOORS 10 class World { private: Floor m_floors[NUM_FLOORS]; int m_currentFloor; public: World(); ~World(); void release(); void initialize(); void se...
C++
#pragma once // Direct Input includes #include <dinput.h> #pragma comment(lib, "dinput8.lib") #pragma comment(lib, "dxguid.lib") #include "v2d.h" // This class handles input for the entire game and is a singleton for ease of use class Input { private: HWND m_hWnd; IDirectInput8 * m_pDInput; // Direct ...
C++
#pragma once #include "HelpfulData.h" #include "GraphNode.h" #include "Texture.h" class Graph { private: // the number of nodes in the graph int m_size; // relation ship of nodes in the graph bool **m_AdjacencyMatrix; // all nodes in the graph TemplateVector<GraphNode*> m_nodes; // texture used fo...
C++
#pragma once #include "DX2DEngine.h" #include "HelpfulData.h" enum Orientation {TOP_LEFT,TOP_RIGHT,CENTER,BOT_RIGHT,BOT_LEFT,TOP_CENTER,BOT_CENTER}; class Message_Box { private: char * m_message; int m_length; V2DF m_pos; int m_width; int m_height; Orientation m_drawPoint; Orientation m_textPoin...
C++
#include "GraphNode.h" GraphNode::GraphNode() {} // make sure the safer release is called GraphNode::~GraphNode() {release();} void GraphNode::release() { m_neighbors.release(); } // setup node at given position void GraphNode::initialize(V2DF a_pos) { totalNeighbors = 0; m_position = a_pos; } ...
C++
#include "MessageBox.h" // set data to defaults Message_Box::Message_Box() { m_message = 0; m_length = 0; } // make sure safer release is called Message_Box::~Message_Box() { release(); } // safetly release all data void Message_Box::release() { if(m_message) { delete [] m_message; m_messa...
C++
#pragma once #include "Texture.h" class SpriteSheet : public Texture { protected: TemplateVector<RECT> m_rects; int m_index; int m_rows; int m_columns; public: SpriteSheet(); ~SpriteSheet(); void release(); void initialize(LPCWSTR fileName, int count, int numRows, int numColumns, int spriteWidth,...
C++
#pragma once /////////////////////////////////////////////////////////////////////////// // General Windows includes /////////////////////////////////////////////////////////////////////////// #include <stdio.h> #pragma comment(lib, "winmm.lib") ////////////////////////////////////////////////////////////////////...
C++
#include "Line.h" // make sure pointer is 0 Line::Line() { m_tex = 0; } // make sure safe release is called Line::~Line() { release(); } // safetly release all stored data void Line::release() { } // setup texture and start and end points void Line::initialize(Texture * a_tex, V2DF start, V2DF end) {...
C++
#pragma once #include "Tile.h" #include "Entity.h" #include "Graph.h" #define FLOORSIZE 30 class Floor { private: Tile m_layout[FLOORSIZE][FLOORSIZE]; bool m_cleared; bool m_visited; public: Floor(); ~Floor(); void release(); void intialize(char * fileName); void update(float dT); void ren...
C++
/* * Copyright 2011, Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
C++