You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(70) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|
From: <sik...@us...> - 2006-05-21 18:45:45
|
Revision: 55 Author: sik0fewl Date: 2006-05-21 11:45:39 -0700 (Sun, 21 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=55&view=rev Log Message: ----------- moving directory Added Paths: ----------- trunk/perceptioncrash/src/item_system/ Removed Paths: ------------- trunk/perceptioncrash/src/Item System/ Copied: trunk/perceptioncrash/src/item_system (from rev 54, trunk/perceptioncrash/src/Item System) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sir...@us...> - 2006-05-21 17:20:18
|
Revision: 54 Author: sirisian Date: 2006-05-21 10:20:13 -0700 (Sun, 21 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=54&view=rev Log Message: ----------- Removed Paths: ------------- trunk/perceptioncrash/src/Item System/This is where Sirisian code is_ this is a text.txt Deleted: trunk/perceptioncrash/src/Item System/This is where Sirisian code is_ this is a text.txt =================================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sir...@us...> - 2006-05-21 06:00:59
|
Revision: 53 Author: sirisian Date: 2006-05-20 23:00:48 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=53&view=rev Log Message: ----------- Added Paths: ----------- trunk/perceptioncrash/src/Item System/cDATA_itemSystem.hpp trunk/perceptioncrash/src/Item System/cDATA_weaponItem.hpp trunk/perceptioncrash/src/Item System/c_itemSystem.hpp trunk/perceptioncrash/src/Item System/c_weaponItem.hpp Added: trunk/perceptioncrash/src/Item System/cDATA_itemSystem.hpp =================================================================== --- trunk/perceptioncrash/src/Item System/cDATA_itemSystem.hpp (rev 0) +++ trunk/perceptioncrash/src/Item System/cDATA_itemSystem.hpp 2006-05-21 06:00:48 UTC (rev 53) @@ -0,0 +1,192 @@ +class cDATA_buff +{ + struct s_statBuff + { + std::string attributeName; + int value; + int interval; + }; +public: + std::vector<s_statBuff> buffArray; + void addBuff(std::string attributeName,int value, int interval){ // you'd add a buff like itemData.editLastCreated().addBuff("health rejuvenation", 10,100); meaning a buff of 10 to health rujevenation over 100 time + buffArray[buffArray.size()].value = value; + buffArray[buffArray.size()].attributeName = attributeName; + buffArray[buffArray.size()].interval = interval; + buffArray.push_back(s_statBuff()); + } + std::vector<cDATA_buff::s_statBuff> & getBuffs(){ + return buffArray; + } +}; + +class cDATA_item +{ +public: + virtual cDATA_item::~cDATA_item(){} + + std::string name; + std::string classification; + int size; + int rareness; + int questNumber; +}; + +class cDATA_supplyItem: public cDATA_item +{ +public: + enumSupplyType supplyType; +}; + +class cDATA_usuableItem: public cDATA_item +{ +public: + enumUsuableType usuableType; + int baseAmount; + int cooldownPerUse; + cDATA_buff attributeBuffs; +}; + +class cDATA_ammoItem: public cDATA_item +{ +public: + enumAmmoType ammoType; + + cDATA_ammoItem::cDATA_ammoItem(){ + + } +}; + +class cDATA_equipableItem: public cDATA_item +{ +public: + enumEquipableType equipableType; + cDATA_buff attributeBuffs; + + cDATA_equipableItem::cDATA_equipableItem(){ + + } + cDATA_equipableItem::~cDATA_equipableItem(){ + + } +}; +#include "cDATA_weaponItem.hpp" + +class cDATA_itemDataFactory +{ +public: + cDATA_item *Create(std::string classification) + { + if(classification=="supply") + return new cDATA_supplyItem; + else if(classification=="usuable") + return new cDATA_usuableItem; + else if(classification=="ammo") + return new cDATA_ammoItem; + else if(classification=="equipable") + return new cDATA_equipableItem; + else if(classification=="weapon") + return new cDATA_weaponItem; + } +}; +class cDATA_itemData +{ +private: +cDATA_itemDataFactory itemDataFactory; +int listIndex; +int listSize; +int listCounter; +public: + vector<cDATA_item*> itemData; + int lastIndex; + + cDATA_itemData::cDATA_itemData(){ + listIndex = 0; + listSize = 10; + } + + cDATA_itemData::~cDATA_itemData(){ + while(!itemData.empty()){ + delete itemData[itemData.size()-1]; + itemData.pop_back(); + } + } + + void addItem(std::string classification, std::string name, int size, int rareness, int questNumber) + { + itemData.push_back(itemDataFactory.Create(classification)); + + itemData[itemData.size()-1]->name = name; + itemData[itemData.size()-1]->classification = classification; + itemData[itemData.size()-1]->size = size; + itemData[itemData.size()-1]->rareness = rareness; + itemData[itemData.size()-1]->questNumber = questNumber; + lastIndex=itemData.size()-1; + } + + cDATA_item & editLastCreated(){ + return * itemData[lastIndex]; + } + + cDATA_item & editItemData(int index){ + return *itemData[index]; + } + int getListIndex(){ + return listIndex; + } + int getListSize(){ + return listSize; + } + void checkClick(int mouseX, int mouseY, bool mouseDown, int offsetX, int offsetY){ + if(listCounter<10) + listCounter++; + if(mouseDown==true && listCounter == 10){ + listCounter = 0; + if(mouseX>offsetX && mouseX<offsetX+200 && mouseY>offsetY && mouseY<offsetY+20) + if(listIndex > 0) listIndex--; + + if(mouseX>offsetX && mouseX<offsetX+200 && mouseY>offsetY+(listSize+1)*20 && mouseY<offsetY+20+(listSize+1)*20) + if(listIndex+listSize < itemData.size()) listIndex++; + } + } + + void show(int offsetX, int offsetY){ + glBegin(GL_QUADS); + glColor4ub(200, 200, 200, 255); + glVertex2f(offsetX, offsetY); + glVertex2f(200+offsetX, offsetY); + glVertex2f(200+offsetX, 20+offsetY); + glVertex2f(offsetX, 20+offsetY); + glEnd(); + for(int cycleDataItems = listIndex, drawY = 0; cycleDataItems<(listIndex + listSize > itemData.size() ? itemData.size() : listIndex + listSize); ++cycleDataItems, ++drawY){ + glBegin(GL_QUADS); + glColor4ub(150, 150, 150, 255); + glVertex2f(offsetX, drawY*20+20+offsetY); + glVertex2f(200+offsetX, drawY*20+20+offsetY); + glVertex2f(200+offsetX, drawY*20+40+offsetY); + glVertex2f(offsetX, drawY*20+40+offsetY); + glEnd(); + switch(itemData[cycleDataItems]->rareness){ + case 0: + drawglyphs(itemData[cycleDataItems]->name, 60, 100+offsetX, 5+drawY*20+20+offsetY, 0, 3, 0, 204, 0, 255); + break; + case 1: + drawglyphs(itemData[cycleDataItems]->name, 60, 100+offsetX, 5+drawY*20+20+offsetY, 0, 3, 255, 255, 0, 255); + break; + case 2: + drawglyphs(itemData[cycleDataItems]->name, 60, 100+offsetX, 5+drawY*20+20+offsetY, 0, 3, 204, 0, 255, 255); + break; + } + } + glBegin(GL_QUADS); + glColor4ub(200, 200, 200, 255); + glVertex2f(offsetX, (listSize+1)*20+offsetY); + glVertex2f(200+offsetX, (listSize+1)*20+offsetY); + glVertex2f(200+offsetX, (listSize+1)*20+20+offsetY); + glVertex2f(offsetX, (listSize+1)*20+20+offsetY); + glEnd(); + + drawglyphs("up", 60, 100+offsetX, 5+offsetY, 0, 3, 0, 204, 0, 255); + drawglyphs("down", 60, 100+offsetX, 5+(listSize+1)*20+offsetY, 0, 3, 0, 204, 0, 255); + } +}; + Added: trunk/perceptioncrash/src/Item System/cDATA_weaponItem.hpp =================================================================== --- trunk/perceptioncrash/src/Item System/cDATA_weaponItem.hpp (rev 0) +++ trunk/perceptioncrash/src/Item System/cDATA_weaponItem.hpp 2006-05-21 06:00:48 UTC (rev 53) @@ -0,0 +1,121 @@ +struct s_color +{ + int r, g, b, a;//red,green,blue,alpha +}; +struct s_dataRange +{ + int min, max;//The minimum and maximum of the range. +}; +class cDATA_weaponItem : public cDATA_equipableItem +{ + struct s_modeAccuracy + { + int value;//Accuracy of the Gun -(value) to value modifier + int add;//Amount to add to accuracy when firing + int delay;//How many bullets have to be fired before the COF goes up + int delayTime;//The amount of time for the delay to reset + int cooldownTime;//The time it takes for the accuracy modifier to go down + int cooldownAmount;//The amount the accuracy will go down after the counter equals the time + //add crouch values later + }; + struct s_modeFireRate + { + int value;//Rate at which bullets are fired + int fireModeIndex; + int reFireRate; + int reFireModeIndex; + }; + struct s_modeChargeRate + { + int chargeType;//Charge for Each Bullet, Only Burst Fire, Only ShotGun + int value;//The amount the gun has to charge before firing + bool lockTheGun;//When performing the structures action is the gun locked from doing other things? + }; + struct s_modeStatMod + { + s_dataRange speed; + s_dataRange range; + //ect to have all the mods possible + int fireModeIndex; + }; + struct s_modeReload + { + int value;//The time it takes to reload + bool lockTheGun;//When performing the structures action is the gun locked from doing other things? + int fireModeIndex;//redirects to another firing mode if not its own + }; + struct s_modeBurstShot + { + int value;//How many times the Gun burst shots. + bool lockTheGun;//When performing the structures action is the gun locked from doing other things? + int fireModeIndex;//redirects to another firing mode if not its own + }; + struct s_modeSpreadShot//The number of projectiles fired at one time + { + int value; + bool lockTheGun;//When performing the structures action is the gun locked from doing other things? + int fireModeIndex;//redirects to another firing mode if not its own + }; + struct s_modeAmmoAndClip + { + int ammoType;//Solid, Energy, Grenade, Rocket + int caliber;//The size of the Rounds + int clipType;//Normal Magazine, Banana Clip, Shell Clip, Top-Load Magazine, Canister + s_dataRange speed;//Ammo has different speed classifications, 0-100, and the gun can only use ammo between two values + s_dataRange damageClass;//Ammo has different damage classifications, 0-100, and the gun can only use ammo between two values + s_dataRange range;//Ammo has different range classifications, 0-100, and the gun can only use ammo between two values + s_dataRange ammoCapacity;//Ammo has different ammo capacity classifications, 0-100, and the gun can only use ammo between two values + int fireModeIndex;//redirects to another firing mode if not its own + }; + struct s_modeParticles //When gun is fired, the particles that are created + { + s_color color; + int image; + int interval; + int amount; + int range; + int speed; + s_dataRange angle; + int fireModeIndex;//redirects to another firing mode if not its own + }; + struct s_modeMelee + { + bool value;//Whether the gun can melee + int range;//The range of the melee attack + int baseDamage;//The normal damage of the melee + int modDamage;//Any extra damage the gun may do + int interval;//The time it takes to melee with the weapon + }; + struct s_firingMode + { + s_modeAccuracy accuracy; + s_modeFireRate fireRate; + s_modeChargeRate chargeRate; + s_modeStatMod statMod; + s_modeReload reload; + s_modeBurstShot burstShot; + s_modeSpreadShot spreadShot; + s_modeAmmoAndClip ammoAndClip; + s_modeParticles fireParticles; + }; + +private: + s_modeMelee melee; + std::vector<s_firingMode> firingModes; + +public: + cDATA_weaponItem::cDATA_weaponItem(){ + + } + void Initialize(int numberOfFiringModes){ + for(int expandFiringModes = 0; expandFiringModes < numberOfFiringModes; ++expandFiringModes){ + firingModes.push_back(s_firingMode()); + } + } + s_firingMode & cDATA_weaponItem::editFiringMode(int firingMode){ + return firingModes[firingMode]; + } + s_modeMelee & cDATA_weaponItem::editMelee(int firingMode){ + return melee; + } +}; Added: trunk/perceptioncrash/src/Item System/c_itemSystem.hpp =================================================================== --- trunk/perceptioncrash/src/Item System/c_itemSystem.hpp (rev 0) +++ trunk/perceptioncrash/src/Item System/c_itemSystem.hpp 2006-05-21 06:00:48 UTC (rev 53) @@ -0,0 +1,186 @@ +class c_item +{ +public: + virtual c_item::~c_item(){} + int itemDataIndex; + int quantity; + bool slotUsed; +}; + +class c_supplyItem: public c_item +{ +public: + +}; + +class c_usuableItem: public c_item +{ +public: + enumUsuableType usuableType; + int amountLeft; + int cooldownCounter; + c_usuableItem::c_usuableItem(){ + amountLeft = 0; + cooldownCounter = 0; + } +}; + +class c_ammoItem: public c_item +{ +public: + enumAmmoType ammoType; + + c_ammoItem::c_ammoItem(){ + + } +}; + +class c_equipableItem: public c_item +{ +public: + c_equipableItem::c_equipableItem(){ + + } + c_equipableItem::~c_equipableItem(){ + + } +}; +#include "c_weaponItem.hpp" +class c_itemDataFactory +{ +public: + c_item *Create(std::string classification) + { + if(classification=="supply") + return new c_supplyItem; + else if(classification=="usuable") + return new c_usuableItem; + else if(classification=="ammo") + return new c_ammoItem; + else if(classification=="equipable") + return new c_equipableItem; + else if(classification=="weapon") + return new c_weaponItem; + } +}; + +class c_itemInventory +{ +private: +c_itemDataFactory itemDataFactory; +int listIndex; +int listSize; +int listCounter; +public: + vector<c_item*> itemInventoryData; + + c_itemInventory::c_itemInventory(){ + listIndex = 0; + listSize = 10; + } + + c_itemInventory::~c_itemInventory(){ + while(!itemInventoryData.empty()){ + delete itemInventoryData[itemInventoryData.size()-1]; + itemInventoryData.pop_back(); + } + } + + void addItem(int itemDataIndex, int quantity, cDATA_itemData & itemData) + { + + for(int cycleItems = 0; cycleItems < itemInventoryData.size(); ++cycleItems){ + if(itemInventoryData[cycleItems]->slotUsed == false){ + delete itemInventoryData[cycleItems]; + itemInventoryData[cycleItems] = itemDataFactory.Create(itemData.itemData[itemDataIndex]->classification); + itemInventoryData[cycleItems]->slotUsed = true; + itemInventoryData[cycleItems]->itemDataIndex = itemDataIndex; + itemInventoryData[cycleItems]->quantity = quantity; + return; + } + } + + itemInventoryData.push_back(itemDataFactory.Create(itemData.itemData[itemDataIndex]->classification)); + itemInventoryData[itemInventoryData.size()-1]->slotUsed = true; + itemInventoryData[itemInventoryData.size()-1]->itemDataIndex = itemDataIndex; + itemInventoryData[itemInventoryData.size()-1]->quantity = quantity; + } + + c_item & editItemData(int index){ + return *itemInventoryData[index]; + } + + void checkClick(int mouseX, int mouseY, bool mouseDown, int offsetX, int offsetY){ + if(listCounter<10) + listCounter++; + if(mouseDown==true && listCounter == 10){ + listCounter = 0; + if(mouseX>offsetX && mouseX<offsetX+200 && mouseY>offsetY && mouseY<offsetY+20) + if(listIndex > 0) listIndex--; + + if(mouseX>offsetX && mouseX<offsetX+200 && mouseY>offsetY+(listSize+1)*20 && mouseY<offsetY+20+(listSize+1)*20) + if(listIndex+listSize < itemInventoryData.size()) listIndex++; + + for(int cycleItems = listIndex, checkY = 0; cycleItems < (listIndex+listSize<itemInventoryData.size() ? listIndex+listSize : itemInventoryData.size()); ++cycleItems, ++checkY){ + if(itemInventoryData[cycleItems]->slotUsed == true){ + if(mousex>offsetX && mousex<offsetX+200 && mousey>offsetY+20+checkY*20 && mousey<offsetY+40+checkY*20){ + itemInventoryData[cycleItems]->slotUsed = false; + itemInventoryData.erase(itemInventoryData.begin()+cycleItems ); + break; + } + } + } + } + } + + void show(int offsetX, int offsetY, cDATA_itemData & itemData){ + glBegin(GL_QUADS); + glColor4ub(200, 200, 200, 255); + glVertex2f(offsetX, offsetY); + glVertex2f(200+offsetX, offsetY); + glVertex2f(200+offsetX, 20+offsetY); + glVertex2f(offsetX, 20+offsetY); + glEnd(); + for(int cycleDataItems = listIndex, drawY = 0; cycleDataItems<(listIndex + listSize > itemInventoryData.size() ? itemInventoryData.size() : listIndex + listSize); ++cycleDataItems, ++drawY){ + if(itemInventoryData[cycleDataItems]->slotUsed == true){ + glBegin(GL_QUADS); + glColor4ub(150, 150, 150, 255); + glVertex2f(offsetX, drawY*20+20+offsetY); + glVertex2f(200+offsetX, drawY*20+20+offsetY); + glVertex2f(200+offsetX, drawY*20+40+offsetY); + glVertex2f(offsetX, drawY*20+40+offsetY); + glEnd(); + + switch(itemData.itemData[itemInventoryData[cycleDataItems]->itemDataIndex]->rareness){ + case 0: + drawglyphs(itemData.itemData[itemInventoryData[cycleDataItems]->itemDataIndex]->name, 60, 100+offsetX, 5+drawY*20+20+offsetY, 0, 3, 0, 204, 0, 255); + break; + case 1: + drawglyphs(itemData.itemData[itemInventoryData[cycleDataItems]->itemDataIndex]->name, 60, 100+offsetX, 5+drawY*20+20+offsetY, 0, 3, 255, 255, 0, 255); + break; + case 2: + drawglyphs(itemData.itemData[itemInventoryData[cycleDataItems]->itemDataIndex]->name, 60, 100+offsetX, 5+drawY*20+20+offsetY, 0, 3, 204, 0, 255, 255); + break; + } + }else{ + glBegin(GL_QUADS); + glColor4ub(255, 0, 255, 255); + glVertex2f(offsetX, drawY*20+20+offsetY); + glVertex2f(200+offsetX, drawY*20+20+offsetY); + glVertex2f(200+offsetX, drawY*20+40+offsetY); + glVertex2f(offsetX, drawY*20+40+offsetY); + glEnd(); + } + } + glBegin(GL_QUADS); + glColor4ub(200, 200, 200, 255); + glVertex2f(offsetX, (listSize+1)*20+offsetY); + glVertex2f(200+offsetX, (listSize+1)*20+offsetY); + glVertex2f(200+offsetX, (listSize+1)*20+20+offsetY); + glVertex2f(offsetX, (listSize+1)*20+20+offsetY); + glEnd(); + + drawglyphs("up", 60, 100+offsetX, 5+offsetY, 0, 3, 0, 204, 0, 255); + drawglyphs("down", 60, 100+offsetX, 5+(listSize+1)*20+offsetY, 0, 3, 0, 204, 0, 255); + } +}; Added: trunk/perceptioncrash/src/Item System/c_weaponItem.hpp =================================================================== --- trunk/perceptioncrash/src/Item System/c_weaponItem.hpp (rev 0) +++ trunk/perceptioncrash/src/Item System/c_weaponItem.hpp 2006-05-21 06:00:48 UTC (rev 53) @@ -0,0 +1,78 @@ +class c_weaponItem : public c_equipableItem +{ + struct s_modeAccuracy + { + int delayCounter; + int cooldownCounter; + //add crouch values later + }; + struct s_modeFireRate + { + int rateCounter; + int reFireRateCounter; + }; + struct s_modeChargeRate + { + int chargeCounter; + }; + struct s_modeStatMod + { + int speedMod; + int rangeMod; + //ect to have all the mods possible + }; + struct s_modeReload + { + int counter; + }; + struct s_modeBurstShot + { + int counter; + }; + struct s_modeSpreadShot//The number of projectiles fired at one time + { + int counter; + }; + struct s_modeAmmoAndClip + { + int itemNumber; + }; + struct s_modeParticles //When gun is fired, the particles that are created + { + int intervalCounter; + }; + struct s_modeMelee + { + int modDamage;//Any extra damage the gun may do + int intervalCounter;//a counter to keep track of when the gun can melee again + }; + struct s_firingMode + { + s_modeAccuracy accuracy; + s_modeFireRate fireRate; + s_modeChargeRate chargeRate; + s_modeStatMod statMod; + s_modeReload reload; + s_modeBurstShot burstShot; + s_modeSpreadShot spreadShot; + s_modeAmmoAndClip ammoAndClip; + }; +private: + s_modeMelee melee; + std::vector<s_firingMode> firingModes; +public: + c_weaponItem::c_weaponItem(){ + + } + void Initialize(int numberOfFiringModes){ + for(int expandFiringModes = 0; expandFiringModes < numberOfFiringModes; ++expandFiringModes){ + firingModes.push_back(s_firingMode()); + } + } + c_weaponItem::s_firingMode & editFiringMode(int firingMode){ + return firingModes[firingMode]; + } + c_weaponItem::s_modeMelee & editMeleeMode(int firingMode){ + return melee; + } +}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-21 05:03:52
|
Revision: 52 Author: sik0fewl Date: 2006-05-20 22:03:44 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=52&view=rev Log Message: ----------- Doc fix Modified Paths: -------------- trunk/perceptioncrash/Doxyfile trunk/perceptioncrash/src/GameManager.hpp Modified: trunk/perceptioncrash/Doxyfile =================================================================== --- trunk/perceptioncrash/Doxyfile 2006-05-21 04:52:12 UTC (rev 51) +++ trunk/perceptioncrash/Doxyfile 2006-05-21 05:03:44 UTC (rev 52) @@ -101,7 +101,7 @@ # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES -INLINE_SOURCES = YES +INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES Modified: trunk/perceptioncrash/src/GameManager.hpp =================================================================== --- trunk/perceptioncrash/src/GameManager.hpp 2006-05-21 04:52:12 UTC (rev 51) +++ trunk/perceptioncrash/src/GameManager.hpp 2006-05-21 05:03:44 UTC (rev 52) @@ -33,6 +33,7 @@ void start(GameState* state); /** Change state to the specified state. + * * This exits the current state, pops it, pushes the new state and enters * it * @@ -40,7 +41,8 @@ */ void changeState(GameState* state); - /** Push state onto state stack + /** Push new state onto state stack + * * This pauses the current state, pushes the new state onto the game state * stack and enters it * @@ -48,7 +50,8 @@ */ void pushState(GameState* state); - /** Pop state off of state stack + /** Pop current state off of state stack + * * This exits the current state, pops it off the state stack and resumes * the previous state (if any) */ @@ -56,6 +59,7 @@ /** Override standard Ogre::Singleton retrieval. + * * @remarks * * Why do we do this? Well, it's because the Singleton implementation is in @@ -72,6 +76,7 @@ static GameManager& getSingleton(void); /** Override standard Ogre::Singleton retrieval. + * * @remarks * * Why do we do this? Well, it's because the Singleton implementation is in @@ -92,7 +97,7 @@ Ogre::Root* mRoot; /** Render window */ Ogre::RenderWindow* mRenderWindow; - /* Input manager */ + /** Input manager */ InputManager* mInputManager; /** Setup resource locations */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-21 04:52:18
|
Revision: 51 Author: sik0fewl Date: 2006-05-20 21:52:12 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=51&view=rev Log Message: ----------- Some documentation Modified Paths: -------------- trunk/perceptioncrash/src/GameManager.hpp Modified: trunk/perceptioncrash/src/GameManager.hpp =================================================================== --- trunk/perceptioncrash/src/GameManager.hpp 2006-05-20 21:13:19 UTC (rev 50) +++ trunk/perceptioncrash/src/GameManager.hpp 2006-05-21 04:52:12 UTC (rev 51) @@ -10,47 +10,127 @@ class GameState; +/** Main game class. + */ class GameManager : public Ogre::FrameListener, public Ogre::KeyListener, public Ogre::MouseMotionListener, public Ogre::Singleton<GameManager> { public: + /** Default constructor + */ GameManager(); + + /** Default destructor + */ ~GameManager(); + /** Start game from specified game state + * + * @param state game state to start from + */ void start(GameState* state); + + /** Change state to the specified state. + * This exits the current state, pops it, pushes the new state and enters + * it + * + * @param state game state to change to + */ void changeState(GameState* state); + + /** Push state onto state stack + * This pauses the current state, pushes the new state onto the game state + * stack and enters it + * + * @param state game state to push onto stack + */ void pushState(GameState* state); + + /** Pop state off of state stack + * This exits the current state, pops it off the state stack and resumes + * the previous state (if any) + */ void popState(); + + /** Override standard Ogre::Singleton retrieval. + * @remarks + * + * Why do we do this? Well, it's because the Singleton implementation is in + * a .h file, which means it gets compiled into anybody who includes it. + * This is needed for the Singleton template to work, but we actually only + * want it compiled into the implementation of the class based on the + * Singleton, not all of them. If we don't change this, we get link errors + * when trying to use the Singleton-based class from an outside dll. + * + * This method just delegates to the template version anyway, but the + * implementation stays in this single compilation unit, preventing link + * errors. + */ + static GameManager& getSingleton(void); + /** Override standard Ogre::Singleton retrieval. + * @remarks + * + * Why do we do this? Well, it's because the Singleton implementation is in + * a .h file, which means it gets compiled into anybody who includes it. + * This is needed for the Singleton template to work, but we actually only + * want it compiled into the implementation of the class based on the + * Singleton, not all of them. If we don't change this, we get link errors + * when trying to use the Singleton-based class from an outside dll. + * + * This method just delegates to the template version anyway, but the + * implementation stays in this single compilation unit, preventing link + * errors. + */ static GameManager* getSingletonPtr(void); protected: + /** OGRE Root */ Ogre::Root* mRoot; + /** Render window */ Ogre::RenderWindow* mRenderWindow; + /* Input manager */ InputManager* mInputManager; + /** Setup resource locations */ void setupResources(void); + /** Configure OGRE */ bool configure(void); + /** Ogre::KeyListener keyClicked event */ void keyClicked(Ogre::KeyEvent* e); + /** Ogre::KeyListener keyPressed event */ void keyPressed(Ogre::KeyEvent* e); + /** Ogre::KeyListener keyReleased event */ void keyReleased(Ogre::KeyEvent* e); + /** Ogre::MouseMotionListener mouseMoved event */ void mouseMoved(Ogre::MouseEvent* e); + /** Ogre::MouseMotionListener mouseDragged event */ void mouseDragged(Ogre::MouseEvent* e); + /** Ogre::MouseMotionListener mouseDragMoved event */ void mouseDragMoved(Ogre::MouseEvent* e); + /** Ogre::FrameListener frameStarted event */ bool frameStarted(const Ogre::FrameEvent& evt); + /** Ogre::FrameListener frameEnded event */ bool frameEnded(const Ogre::FrameEvent& evt); private: + /** Show/hide dubug panel overlay */ void toggleDebugPanelOverlay(); + /** Update debug panel overlay with current FPS, etc */ void updateDebugPanelOverlay(); + /** Debug panel overlay. + * Shows current FPS another stats on-screen + */ Ogre::Overlay* mDebugPanelOverlay; + + /** State stack */ std::vector<GameState*> mStates; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-20 21:13:27
|
Revision: 50 Author: sik0fewl Date: 2006-05-20 14:13:19 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=50&view=rev Log Message: ----------- Removed KeyboardMap, as functionality is already provided by Ogre::InputReader Modified Paths: -------------- trunk/perceptioncrash/src/GameManager.cpp trunk/perceptioncrash/src/GameManager.hpp Removed Paths: ------------- trunk/perceptioncrash/src/KeyboardMap.cpp trunk/perceptioncrash/src/KeyboardMap.hpp Modified: trunk/perceptioncrash/src/GameManager.cpp =================================================================== --- trunk/perceptioncrash/src/GameManager.cpp 2006-05-20 19:15:19 UTC (rev 49) +++ trunk/perceptioncrash/src/GameManager.cpp 2006-05-20 21:13:19 UTC (rev 50) @@ -3,7 +3,6 @@ #include "GameManager.hpp" #include "InputManager.hpp" -#include "KeyboardMap.hpp" #include "GameState.hpp" template<> GameManager* Ogre::Singleton<GameManager>::ms_Singleton = 0; @@ -12,7 +11,6 @@ { mRoot = 0; mInputManager = 0; - mKeyboardMap = 0; } GameManager::~GameManager() @@ -27,9 +25,6 @@ if (mInputManager) delete mInputManager; - if (mKeyboardMap) - delete mKeyboardMap; - if (mRoot) delete mRoot; } @@ -46,9 +41,7 @@ mRoot->addFrameListener(this); - mKeyboardMap = new KeyboardMap(); mInputManager = new InputManager(mRoot->getAutoCreatedWindow()); - mInputManager->getEventProcessor()->addKeyListener(mKeyboardMap); mInputManager->getEventProcessor()->addKeyListener(this); mInputManager->getEventProcessor()->addMouseMotionListener(this); Modified: trunk/perceptioncrash/src/GameManager.hpp =================================================================== --- trunk/perceptioncrash/src/GameManager.hpp 2006-05-20 19:15:19 UTC (rev 49) +++ trunk/perceptioncrash/src/GameManager.hpp 2006-05-20 21:13:19 UTC (rev 50) @@ -7,7 +7,6 @@ #include <OgreSingleton.h> #include "InputManager.hpp" -#include "KeyboardMap.hpp" class GameState; @@ -32,7 +31,6 @@ Ogre::Root* mRoot; Ogre::RenderWindow* mRenderWindow; InputManager* mInputManager; - KeyboardMap* mKeyboardMap; void setupResources(void); bool configure(void); Deleted: trunk/perceptioncrash/src/KeyboardMap.cpp =================================================================== --- trunk/perceptioncrash/src/KeyboardMap.cpp 2006-05-20 19:15:19 UTC (rev 49) +++ trunk/perceptioncrash/src/KeyboardMap.cpp 2006-05-20 21:13:19 UTC (rev 50) @@ -1,13 +0,0 @@ -#include <Ogre.h> -#include <OgreKeyEvent.h> -#include <OgreSingleton.h> - -#include "KeyboardMap.hpp" - -template<> KeyboardMap* Ogre::Singleton<KeyboardMap>::ms_Singleton = 0; - -bool -KeyboardMap::isDown(int key) -{ - return keyMap[key]; -} Deleted: trunk/perceptioncrash/src/KeyboardMap.hpp =================================================================== --- trunk/perceptioncrash/src/KeyboardMap.hpp 2006-05-20 19:15:19 UTC (rev 49) +++ trunk/perceptioncrash/src/KeyboardMap.hpp 2006-05-20 21:13:19 UTC (rev 50) @@ -1,28 +0,0 @@ -#ifndef PC_KEYBOARD_MAP -#define PC_KEYBOARD_MAP - -#include <map> - -#include <Ogre.h> -#include <OgreKeyEvent.h> -#include <OgreEventListeners.h> -#include <OgreSingleton.h> - -class KeyboardMap : public Ogre::KeyListener, - public Ogre::Singleton<KeyboardMap> -{ - public: - bool isDown(int key); - - protected: - void keyClicked(Ogre::KeyEvent* e) { } - void keyPressed(Ogre::KeyEvent* e) - { keyMap[e->getKey()] = true; } - void keyReleased(Ogre::KeyEvent* e) - { keyMap[e->getKey()] = false; } - - private: - std::map<int, bool> keyMap; -}; - -#endif /* PC_KEYBOARD_MAP */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sir...@us...> - 2006-05-20 19:15:23
|
Revision: 49 Author: sirisian Date: 2006-05-20 12:15:19 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=49&view=rev Log Message: ----------- Sirisian's Stuff. A test to show where my source code test will be so others can see it. Added Paths: ----------- trunk/perceptioncrash/src/Item System/ trunk/perceptioncrash/src/Item System/This is where Sirisian code is_ this is a text.txt Added: trunk/perceptioncrash/src/Item System/This is where Sirisian code is_ this is a text.txt =================================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-20 18:39:55
|
Revision: 48 Author: sik0fewl Date: 2006-05-20 11:39:44 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=48&view=rev Log Message: ----------- Moved tinyxml into lib/ directory Created build rules for TinyXML library Modified Paths: -------------- trunk/perceptioncrash/Jamfile trunk/perceptioncrash/Jamrules trunk/perceptioncrash/src/Jamfile Added Paths: ----------- trunk/perceptioncrash/lib/ trunk/perceptioncrash/lib/Jamfile trunk/perceptioncrash/lib/tinyxml/ trunk/perceptioncrash/lib/tinyxml/Jamfile Removed Paths: ------------- trunk/perceptioncrash/src/tinyxml/ Modified: trunk/perceptioncrash/Jamfile =================================================================== --- trunk/perceptioncrash/Jamfile 2006-05-19 18:48:13 UTC (rev 47) +++ trunk/perceptioncrash/Jamfile 2006-05-20 18:39:44 UTC (rev 48) @@ -1,5 +1,6 @@ SubDir TOP ; +SubInclude TOP lib ; SubInclude TOP src ; UseAutoconf ; Modified: trunk/perceptioncrash/Jamrules =================================================================== --- trunk/perceptioncrash/Jamrules 2006-05-19 18:48:13 UTC (rev 47) +++ trunk/perceptioncrash/Jamrules 2006-05-20 18:39:44 UTC (rev 48) @@ -40,5 +40,6 @@ # Include the top_builddir dir, because it contains config.h IncludeDir $(top_builddir) ; -# also add the src dir as include directory +# also add the src and lib dirs as include directories IncludeDir $(TOP)/src ; +IncludeDir $(TOP)/lib ; Added: trunk/perceptioncrash/lib/Jamfile =================================================================== --- trunk/perceptioncrash/lib/Jamfile (rev 0) +++ trunk/perceptioncrash/lib/Jamfile 2006-05-20 18:39:44 UTC (rev 48) @@ -0,0 +1,3 @@ +SubDir TOP lib ; + +SubInclude TOP lib tinyxml ; Copied: trunk/perceptioncrash/lib/tinyxml (from rev 47, trunk/perceptioncrash/src/tinyxml) Added: trunk/perceptioncrash/lib/tinyxml/Jamfile =================================================================== --- trunk/perceptioncrash/lib/tinyxml/Jamfile (rev 0) +++ trunk/perceptioncrash/lib/tinyxml/Jamfile 2006-05-20 18:39:44 UTC (rev 48) @@ -0,0 +1,11 @@ +SubDir TOP lib tinyxml ; + +# TinyXML source files +Library tinyxml + : tinystr.h tinyxml.h tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp + : noinstall ; + +#ExternalLibs perceptioncrash : OGRE CEGUI CEGUIOGRERENDERER ; + +# Construct a description for the help target +Help tinyxml : "Build the TinyXML library" ; Modified: trunk/perceptioncrash/src/Jamfile =================================================================== --- trunk/perceptioncrash/src/Jamfile 2006-05-19 18:48:13 UTC (rev 47) +++ trunk/perceptioncrash/src/Jamfile 2006-05-20 18:39:44 UTC (rev 48) @@ -6,9 +6,6 @@ [ Wildcard *.cpp *.hpp ] ; -# We link with the samplelib from the same package -#LinkWith sample : sharedlib staticlib ; - # If SDL is available we link with it and define SDL_AVAILABLE constant #if $(SDL_LIBS) != "" || $(SDL_CFLAGS) != "" #{ @@ -17,6 +14,7 @@ #} Application perceptioncrash : $(sources) ; +LinkWith perceptioncrash : tinyxml ; ExternalLibs perceptioncrash : OGRE CEGUI CEGUIOGRERENDERER ; # Construct a description for the help target This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <wor...@us...> - 2006-05-19 18:48:20
|
Revision: 47 Author: workmad3 Date: 2006-05-19 11:48:13 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=47&view=rev Log Message: ----------- updated the VC++ project file again. Will people PLEASE stop moving it? Modified Paths: -------------- trunk/perceptioncrash/contrib/VC++Project/perceptioncrash/perceptioncrash.vcproj Modified: trunk/perceptioncrash/contrib/VC++Project/perceptioncrash/perceptioncrash.vcproj =================================================================== --- trunk/perceptioncrash/contrib/VC++Project/perceptioncrash/perceptioncrash.vcproj 2006-05-19 17:27:43 UTC (rev 46) +++ trunk/perceptioncrash/contrib/VC++Project/perceptioncrash/perceptioncrash.vcproj 2006-05-19 18:48:13 UTC (rev 47) @@ -47,6 +47,8 @@ RuntimeLibrary="3" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" + ObjectFile="..\..\..\build\" + ProgramDataBaseFileName="..\..\..\build\vc80.pdb" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" @@ -63,7 +65,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="OgreMain_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib" - OutputFile="..\..\bin\debug\$(ProjectName).exe" + OutputFile="..\..\..\$(ProjectName).exe" LinkIncremental="2" AdditionalLibraryDirectories="$(OGRE_HOME)\lib" GenerateDebugInformation="true" @@ -94,7 +96,6 @@ /> <Tool Name="VCPostBuildEventTool" - Description="" CommandLine="" /> </Configuration> @@ -131,6 +132,8 @@ RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" + ObjectFile="..\..\..\build\" + ProgramDataBaseFileName="..\..\..\build\vc80.pdb" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" @@ -147,7 +150,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib" - OutputFile="..\..\bin\release\$(ProjectName).exe" + OutputFile="..\..\..\$(ProjectName).exe" LinkIncremental="1" AdditionalLibraryDirectories="$(OGRE_HOME)\lib" GenerateDebugInformation="true" @@ -179,7 +182,6 @@ /> <Tool Name="VCPostBuildEventTool" - Description="" CommandLine="" /> </Configuration> @@ -193,29 +195,33 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File - RelativePath="..\..\src\GameManager.cpp" + RelativePath="..\..\..\src\GameManager.cpp" > </File> <File - RelativePath="..\..\src\InputManager.cpp" + RelativePath="..\..\..\src\InputManager.cpp" > </File> <File - RelativePath="..\..\src\IntroState.cpp" + RelativePath="..\..\..\src\IntroState.cpp" > </File> <File - RelativePath="..\..\src\main.cpp" + RelativePath="..\..\..\src\KeyboardMap.cpp" > </File> <File - RelativePath="..\..\src\PauseState.cpp" + RelativePath="..\..\..\src\main.cpp" > </File> <File - RelativePath="..\..\src\PlayState.cpp" + RelativePath="..\..\..\src\PauseState.cpp" > </File> + <File + RelativePath="..\..\..\src\PlayState.cpp" + > + </File> </Filter> <Filter Name="Header Files" @@ -223,29 +229,33 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > <File - RelativePath="..\..\src\GameManager.hpp" + RelativePath="..\..\..\src\GameManager.hpp" > </File> <File - RelativePath="..\..\src\GameState.hpp" + RelativePath="..\..\..\src\GameState.hpp" > </File> <File - RelativePath="..\..\src\InputManager.hpp" + RelativePath="..\..\..\src\InputManager.hpp" > </File> <File - RelativePath="..\..\src\IntroState.hpp" + RelativePath="..\..\..\src\IntroState.hpp" > </File> <File - RelativePath="..\..\src\PauseState.hpp" + RelativePath="..\..\..\src\KeyboardMap.hpp" > </File> <File - RelativePath="..\..\src\PlayState.hpp" + RelativePath="..\..\..\src\PauseState.hpp" > </File> + <File + RelativePath="..\..\..\src\PlayState.hpp" + > + </File> </Filter> <Filter Name="Resource Files" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-19 17:27:53
|
Revision: 46 Author: sik0fewl Date: 2006-05-19 10:27:43 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=46&view=rev Log Message: ----------- Added KeyboardMap class, similar to sdw's original 'Input' class Used to see which keys are currently held down on the keyboard Modified Paths: -------------- trunk/perceptioncrash/src/GameManager.cpp trunk/perceptioncrash/src/GameManager.hpp trunk/perceptioncrash/src/PlayState.cpp Added Paths: ----------- trunk/perceptioncrash/src/KeyboardMap.cpp trunk/perceptioncrash/src/KeyboardMap.hpp Modified: trunk/perceptioncrash/src/GameManager.cpp =================================================================== --- trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 16:04:41 UTC (rev 45) +++ trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 17:27:43 UTC (rev 46) @@ -3,6 +3,7 @@ #include "GameManager.hpp" #include "InputManager.hpp" +#include "KeyboardMap.hpp" #include "GameState.hpp" template<> GameManager* Ogre::Singleton<GameManager>::ms_Singleton = 0; @@ -11,6 +12,7 @@ { mRoot = 0; mInputManager = 0; + mKeyboardMap = 0; } GameManager::~GameManager() @@ -25,6 +27,9 @@ if (mInputManager) delete mInputManager; + if (mKeyboardMap) + delete mKeyboardMap; + if (mRoot) delete mRoot; } @@ -41,10 +46,13 @@ mRoot->addFrameListener(this); + mKeyboardMap = new KeyboardMap(); mInputManager = new InputManager(mRoot->getAutoCreatedWindow()); + mInputManager->getEventProcessor()->addKeyListener(mKeyboardMap); mInputManager->getEventProcessor()->addKeyListener(this); mInputManager->getEventProcessor()->addMouseMotionListener(this); + mDebugPanelOverlay = Ogre::OverlayManager::getSingleton().getByName("Core/DebugOverlay"); changeState(state); Modified: trunk/perceptioncrash/src/GameManager.hpp =================================================================== --- trunk/perceptioncrash/src/GameManager.hpp 2006-05-19 16:04:41 UTC (rev 45) +++ trunk/perceptioncrash/src/GameManager.hpp 2006-05-19 17:27:43 UTC (rev 46) @@ -7,6 +7,7 @@ #include <OgreSingleton.h> #include "InputManager.hpp" +#include "KeyboardMap.hpp" class GameState; @@ -31,6 +32,7 @@ Ogre::Root* mRoot; Ogre::RenderWindow* mRenderWindow; InputManager* mInputManager; + KeyboardMap* mKeyboardMap; void setupResources(void); bool configure(void); Added: trunk/perceptioncrash/src/KeyboardMap.cpp =================================================================== --- trunk/perceptioncrash/src/KeyboardMap.cpp (rev 0) +++ trunk/perceptioncrash/src/KeyboardMap.cpp 2006-05-19 17:27:43 UTC (rev 46) @@ -0,0 +1,13 @@ +#include <Ogre.h> +#include <OgreKeyEvent.h> +#include <OgreSingleton.h> + +#include "KeyboardMap.hpp" + +template<> KeyboardMap* Ogre::Singleton<KeyboardMap>::ms_Singleton = 0; + +bool +KeyboardMap::isDown(int key) +{ + return keyMap[key]; +} Property changes on: trunk/perceptioncrash/src/KeyboardMap.cpp ___________________________________________________________________ Name: svn:keywrords + Id Name: svn:eol-style + native Added: trunk/perceptioncrash/src/KeyboardMap.hpp =================================================================== --- trunk/perceptioncrash/src/KeyboardMap.hpp (rev 0) +++ trunk/perceptioncrash/src/KeyboardMap.hpp 2006-05-19 17:27:43 UTC (rev 46) @@ -0,0 +1,28 @@ +#ifndef PC_KEYBOARD_MAP +#define PC_KEYBOARD_MAP + +#include <map> + +#include <Ogre.h> +#include <OgreKeyEvent.h> +#include <OgreEventListeners.h> +#include <OgreSingleton.h> + +class KeyboardMap : public Ogre::KeyListener, + public Ogre::Singleton<KeyboardMap> +{ + public: + bool isDown(int key); + + protected: + void keyClicked(Ogre::KeyEvent* e) { } + void keyPressed(Ogre::KeyEvent* e) + { keyMap[e->getKey()] = true; } + void keyReleased(Ogre::KeyEvent* e) + { keyMap[e->getKey()] = false; } + + private: + std::map<int, bool> keyMap; +}; + +#endif /* PC_KEYBOARD_MAP */ Modified: trunk/perceptioncrash/src/PlayState.cpp =================================================================== --- trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 16:04:41 UTC (rev 45) +++ trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 17:27:43 UTC (rev 46) @@ -6,6 +6,8 @@ #include "IntroState.hpp" #include "PauseState.hpp" +#include <iostream> + PlayState PlayState::mPlayState; void @@ -73,6 +75,10 @@ void PlayState::keyClicked(Ogre::KeyEvent* e) { + if (e->getKey() == Ogre::KC_DOWN) + { + mCamera->setPosition(mCamera->getPosition() - Ogre::Vector3(0, 1, 0)); + } } void @@ -82,8 +88,7 @@ { pushState(PauseState::getInstance()); } - - if (e->getKey() == Ogre::KC_ESCAPE) + else if (e->getKey() == Ogre::KC_ESCAPE) { changeState(IntroState::getInstance()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-19 16:04:47
|
Revision: 45 Author: sik0fewl Date: 2006-05-19 09:04:41 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=45&view=rev Log Message: ----------- Adding some 'standard' directories Added Paths: ----------- trunk/perceptioncrash/data/fonts/ trunk/perceptioncrash/data/gui/ trunk/perceptioncrash/data/models/ trunk/perceptioncrash/data/particles/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-19 15:56:40
|
Revision: 44 Author: sik0fewl Date: 2006-05-19 08:56:34 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=44&view=rev Log Message: ----------- Playing around a bit Modified Paths: -------------- trunk/perceptioncrash/src/GameManager.cpp trunk/perceptioncrash/src/PlayState.cpp Modified: trunk/perceptioncrash/src/GameManager.cpp =================================================================== --- trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 14:35:07 UTC (rev 43) +++ trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 15:56:34 UTC (rev 44) @@ -47,7 +47,6 @@ mDebugPanelOverlay = Ogre::OverlayManager::getSingleton().getByName("Core/DebugOverlay"); - changeState(state); mRoot->startRendering(); @@ -112,7 +111,7 @@ rgm->addResourceLocation("data/materials/textures", "FileSystem", "General"); rgm->addResourceLocation("data/materials/programs", "FileSystem", "General"); rgm->addResourceLocation("data/packs/OgreCore.zip", "Zip", "General"); - rgm->addResourceLocation("data/maps/ogretestmap.zip", "Zip", rgm->getWorldResourceGroupName()); + rgm->addResourceLocation("data/maps/ogretestmap.zip", "Zip", "PlayStateResources"); #if 0 // load resource paths from config file Modified: trunk/perceptioncrash/src/PlayState.cpp =================================================================== --- trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 14:35:07 UTC (rev 43) +++ trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 15:56:34 UTC (rev 44) @@ -24,6 +24,7 @@ Ogre::Real(mViewport->getActualHeight())); Ogre::ResourceGroupManager* rgm = Ogre::ResourceGroupManager::getSingletonPtr(); + rgm->setWorldResourceGroupName("PlayStateResources"); rgm->linkWorldGeometryToResourceGroup(rgm->getWorldResourceGroupName(), "ogretestmap.bsp", mSceneMgr); @@ -31,6 +32,7 @@ // sdw: This line causes me to crash, i don't know why. It works fine in another // project, and used to in this one, until something must have changed. rgm->loadResourceGroup(rgm->getWorldResourceGroupName(), false, true); + mSceneMgr->setAmbientLight(Ogre::ColourValue(1, 1, 1)); Ogre::ViewPoint vp = mSceneMgr->getSuggestedViewpoint(true); @@ -50,6 +52,8 @@ if (mLogoOverlay) mLogoOverlay->hide(); + Ogre::ResourceGroupManager::getSingleton().unloadResourceGroup(Ogre::ResourceGroupManager::getSingleton().getWorldResourceGroupName()); + mSceneMgr->clearScene(); mSceneMgr->destroyAllCameras(); mRoot->getAutoCreatedWindow()->removeAllViewports(); @@ -103,18 +107,18 @@ } void -PlayState::mouseMoved(Ogre::MouseEvent *e) +PlayState::mouseMoved(Ogre::MouseEvent* e) { mCamera->yaw(Ogre::Radian(-e->getRelX() * 1.f)); mCamera->pitch(Ogre::Radian(-e->getRelY() * 1.f)); } void -PlayState::mouseDragged(Ogre::MouseEvent *e) +PlayState::mouseDragged(Ogre::MouseEvent* e) { } void -PlayState::mouseDragMoved(Ogre::MouseEvent *e) +PlayState::mouseDragMoved(Ogre::MouseEvent* e) { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-19 14:35:12
|
Revision: 43 Author: sik0fewl Date: 2006-05-19 07:35:07 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=43&view=rev Log Message: ----------- Added debug panel overlay. Press F12 to toggle Modified Paths: -------------- trunk/perceptioncrash/src/GameManager.cpp trunk/perceptioncrash/src/GameManager.hpp Modified: trunk/perceptioncrash/src/GameManager.cpp =================================================================== --- trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 05:48:21 UTC (rev 42) +++ trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 14:35:07 UTC (rev 43) @@ -1,4 +1,5 @@ #include <Ogre.h> +#include <OgreKeyEvent.h> #include "GameManager.hpp" #include "InputManager.hpp" @@ -44,6 +45,9 @@ mInputManager->getEventProcessor()->addKeyListener(this); mInputManager->getEventProcessor()->addMouseMotionListener(this); + mDebugPanelOverlay = Ogre::OverlayManager::getSingleton().getByName("Core/DebugOverlay"); + + changeState(state); mRoot->startRendering(); @@ -168,6 +172,12 @@ void GameManager::keyPressed(Ogre::KeyEvent* e) { + // Stateless code: + if (e->getKey() == Ogre::KC_F12) + { + toggleDebugPanelOverlay(); + } + // call keyPressed of current state mStates.back()->keyPressed(e); } @@ -210,10 +220,59 @@ bool GameManager::frameEnded(const Ogre::FrameEvent& evt) { + // Stateless code: + updateDebugPanelOverlay(); + // call frameEnded of current state return mStates.back()->frameEnded(evt); } +void +GameManager::toggleDebugPanelOverlay() +{ + if (mDebugPanelOverlay) + { + if (mDebugPanelOverlay->isVisible()) + mDebugPanelOverlay->hide(); + else + mDebugPanelOverlay->show(); + } + +} + +void +GameManager::updateDebugPanelOverlay() +{ + static const Ogre::String currFps = "Current FPS: "; + static const Ogre::String avgFps = "Average FPS: "; + static const Ogre::String bestFps = "Best FPS: "; + static const Ogre::String worstFps = "Worst FPS: "; + static const Ogre::String tris = "Triangle Count: "; + + if (mDebugPanelOverlay && mDebugPanelOverlay->isVisible()) + { + Ogre::OverlayElement* guiCurr = Ogre::OverlayManager::getSingleton().getOverlayElement("Core/CurrFps"); + Ogre::OverlayElement* guiAvg = Ogre::OverlayManager::getSingleton().getOverlayElement("Core/AverageFps"); + Ogre::OverlayElement* guiBest = Ogre::OverlayManager::getSingleton().getOverlayElement("Core/BestFps"); + Ogre::OverlayElement* guiWorst = Ogre::OverlayManager::getSingleton().getOverlayElement("Core/WorstFps"); + + const Ogre::RenderTarget::FrameStats& stats = mRenderWindow->getStatistics(); + + guiCurr->setCaption(currFps + Ogre::StringConverter::toString(stats.lastFPS)); + guiAvg->setCaption(avgFps + Ogre::StringConverter::toString(stats.avgFPS)); + guiBest->setCaption(bestFps + Ogre::StringConverter::toString(stats.bestFPS) + +" "+Ogre::StringConverter::toString(stats.bestFrameTime)+" ms"); + guiWorst->setCaption(worstFps + Ogre::StringConverter::toString(stats.worstFPS) + +" "+Ogre::StringConverter::toString(stats.worstFrameTime)+" ms"); + + Ogre::OverlayElement* guiTris = Ogre::OverlayManager::getSingleton().getOverlayElement("Core/NumTris"); + guiTris->setCaption(tris + Ogre::StringConverter::toString(stats.triangleCount)); + + Ogre::OverlayElement* guiDbg = Ogre::OverlayManager::getSingleton().getOverlayElement("Core/DebugText"); + guiDbg->setCaption(mRenderWindow->getDebugText()); + } +} + GameManager* GameManager::getSingletonPtr() { Modified: trunk/perceptioncrash/src/GameManager.hpp =================================================================== --- trunk/perceptioncrash/src/GameManager.hpp 2006-05-19 05:48:21 UTC (rev 42) +++ trunk/perceptioncrash/src/GameManager.hpp 2006-05-19 14:35:07 UTC (rev 43) @@ -47,6 +47,10 @@ bool frameEnded(const Ogre::FrameEvent& evt); private: + void toggleDebugPanelOverlay(); + void updateDebugPanelOverlay(); + + Ogre::Overlay* mDebugPanelOverlay; std::vector<GameState*> mStates; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-19 05:48:41
|
Revision: 42 Author: sik0fewl Date: 2006-05-18 22:48:21 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=42&view=rev Log Message: ----------- Added logo to intro and fancy little corner logo to PlayState Modified Paths: -------------- trunk/perceptioncrash/src/GameManager.cpp trunk/perceptioncrash/src/IntroState.cpp trunk/perceptioncrash/src/PlayState.cpp trunk/perceptioncrash/src/PlayState.hpp Added Paths: ----------- trunk/perceptioncrash/data/materials/ trunk/perceptioncrash/data/materials/programs/ trunk/perceptioncrash/data/materials/scripts/ trunk/perceptioncrash/data/materials/scripts/logo.material trunk/perceptioncrash/data/materials/textures/ trunk/perceptioncrash/data/materials/textures/logo/ trunk/perceptioncrash/data/materials/textures/logo/logo.png trunk/perceptioncrash/data/materials/textures/logo/logo2.png trunk/perceptioncrash/data/overlays/ trunk/perceptioncrash/data/overlays/logo.overlay Removed Paths: ------------- trunk/perceptioncrash/data/images/logo.png Deleted: trunk/perceptioncrash/data/images/logo.png =================================================================== (Binary files differ) Added: trunk/perceptioncrash/data/materials/scripts/logo.material =================================================================== --- trunk/perceptioncrash/data/materials/scripts/logo.material (rev 0) +++ trunk/perceptioncrash/data/materials/scripts/logo.material 2006-05-19 05:48:21 UTC (rev 42) @@ -0,0 +1,31 @@ +material Materials/Logo/LogoLarge +{ + // first, preferred technique + technique + { + pass + { + scene_blend alpha_blend + depth_check off + + texture_unit + { + texture logo/logo.png + } + } + } +} + +material Materials/Logo/LogoLargeGreenGlow : Materials/Logo/LogoLarge +{ + technique + { + pass + { + texture_unit + { + texture logo/logo2.png alpha + } + } + } +} Added: trunk/perceptioncrash/data/materials/textures/logo/logo.png =================================================================== (Binary files differ) Property changes on: trunk/perceptioncrash/data/materials/textures/logo/logo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/perceptioncrash/data/materials/textures/logo/logo2.png =================================================================== (Binary files differ) Property changes on: trunk/perceptioncrash/data/materials/textures/logo/logo2.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/perceptioncrash/data/overlays/logo.overlay =================================================================== --- trunk/perceptioncrash/data/overlays/logo.overlay (rev 0) +++ trunk/perceptioncrash/data/overlays/logo.overlay 2006-05-19 05:48:21 UTC (rev 42) @@ -0,0 +1,66 @@ +// Large logo for intro screen +Overlays/Logo/LogoLarge +{ + zorder 500 + + container Panel(OverlayElements/Logo/LogoLarge/Panel) + { + metrics_mode pixels + + // Dimensions + width 771 + height 235 + + // Center horizantally and vertically + horz_align center + vert_align center + left -385 + top -117 + + material Materials/Logo/LogoLarge + } +} + +Overlays/Logo/LogoLargeGreenGlow +{ + zorder 500 + + container Panel(OverlayElements/Logo/LogoLargeGreenGlow/Panel) + { + metrics_mode pixels + + // Dimensions + width 771 + height 235 + + // Center horizantally and vertically + horz_align center + vert_align center + left -385 + top -117 + + material Materials/Logo/LogoLargeGreenGlow + } +} + +Overlays/Logo/LogoCornerGreenGlow +{ + zorder 500 + + container Panel(OverlayElements/Logo/LogoCornerGreenGlow/Panel) + { + metrics_mode pixels + + // Dimensions + width 154 + height 47 + left 0 + top 2 + + // Center horizantally and vertically + horz_align left + vert_align top + + material Materials/Logo/LogoLargeGreenGlow + } +} Modified: trunk/perceptioncrash/src/GameManager.cpp =================================================================== --- trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 04:10:04 UTC (rev 41) +++ trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 05:48:21 UTC (rev 42) @@ -95,6 +95,7 @@ } } + void GameManager::setupResources(void) { @@ -102,6 +103,10 @@ Ogre::ResourceGroupManager* rgm = Ogre::ResourceGroupManager::getSingletonPtr(); rgm->addResourceLocation("data/objects", "FileSystem", "General"); rgm->addResourceLocation("data/images", "FileSystem", "General"); + rgm->addResourceLocation("data/overlays", "FileSystem", "General"); + rgm->addResourceLocation("data/materials/scripts", "FileSystem", "General"); + rgm->addResourceLocation("data/materials/textures", "FileSystem", "General"); + rgm->addResourceLocation("data/materials/programs", "FileSystem", "General"); rgm->addResourceLocation("data/packs/OgreCore.zip", "Zip", "General"); rgm->addResourceLocation("data/maps/ogretestmap.zip", "Zip", rgm->getWorldResourceGroupName()); Modified: trunk/perceptioncrash/src/IntroState.cpp =================================================================== --- trunk/perceptioncrash/src/IntroState.cpp 2006-05-19 04:10:04 UTC (rev 41) +++ trunk/perceptioncrash/src/IntroState.cpp 2006-05-19 05:48:21 UTC (rev 42) @@ -15,9 +15,9 @@ mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC); mCamera = mSceneMgr->createCamera("IntroCamera"); mViewport = mRoot->getAutoCreatedWindow()->addViewport(mCamera); - mViewport->setBackgroundColour( Ogre::ColourValue(1.0, 1.0, 1.0) ); + mViewport->setBackgroundColour( Ogre::ColourValue(0.0, 0.0, 0.0) ); - mLogoOverlay = Ogre::OverlayManager::getSingleton().getByName("Core/DebugOverlay"); + mLogoOverlay = Ogre::OverlayManager::getSingleton().getByName("Overlays/Logo/LogoLargeGreenGlow"); if (mLogoOverlay) mLogoOverlay->show(); @@ -27,6 +27,9 @@ void IntroState::exit() { + if (mLogoOverlay) + mLogoOverlay->hide(); + mSceneMgr->clearScene(); mSceneMgr->destroyAllCameras(); mRoot->getAutoCreatedWindow()->removeAllViewports(); Modified: trunk/perceptioncrash/src/PlayState.cpp =================================================================== --- trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 04:10:04 UTC (rev 41) +++ trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 05:48:21 UTC (rev 42) @@ -38,11 +38,18 @@ mCamera->pitch(Ogre::Degree(90)); mCamera->rotate(vp.orientation); mCamera->setFixedYawAxis(true, Ogre::Vector3::UNIT_Z); + + mLogoOverlay = Ogre::OverlayManager::getSingleton().getByName("Overlays/Logo/LogoCornerGreenGlow"); + if (mLogoOverlay) + mLogoOverlay->show(); } void PlayState::exit() { + if (mLogoOverlay) + mLogoOverlay->hide(); + mSceneMgr->clearScene(); mSceneMgr->destroyAllCameras(); mRoot->getAutoCreatedWindow()->removeAllViewports(); Modified: trunk/perceptioncrash/src/PlayState.hpp =================================================================== --- trunk/perceptioncrash/src/PlayState.hpp 2006-05-19 04:10:04 UTC (rev 41) +++ trunk/perceptioncrash/src/PlayState.hpp 2006-05-19 05:48:21 UTC (rev 42) @@ -35,6 +35,7 @@ Ogre::SceneManager* mSceneMgr; Ogre::Viewport* mViewport; Ogre::Camera* mCamera; + Ogre::Overlay* mLogoOverlay; private: static PlayState mPlayState; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-19 04:10:12
|
Revision: 41 Author: sik0fewl Date: 2006-05-18 21:10:04 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=41&view=rev Log Message: ----------- Add bin/ and obj/ to svn:ignore Property Changed: ---------------- trunk/perceptioncrash/contrib/VC++Project/perceptioncrash/ Property changes on: trunk/perceptioncrash/contrib/VC++Project/perceptioncrash ___________________________________________________________________ Name: svn:ignore - perceptioncrash.ncb + perceptioncrash.ncb bin obj This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-19 04:04:51
|
Revision: 40 Author: sik0fewl Date: 2006-05-18 21:04:45 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=40&view=rev Log Message: ----------- Removing VC++ generated folders Removed Paths: ------------- trunk/perceptioncrash/contrib/VC++Project/perceptioncrash/bin/ trunk/perceptioncrash/contrib/VC++Project/perceptioncrash/obj/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-19 03:24:14
|
Revision: 39 Author: sik0fewl Date: 2006-05-18 20:24:07 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=39&view=rev Log Message: ----------- Missed a couple lines in last commit Modified Paths: -------------- trunk/perceptioncrash/src/PlayState.cpp trunk/perceptioncrash/src/PlayState.hpp Modified: trunk/perceptioncrash/src/PlayState.cpp =================================================================== --- trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 02:54:56 UTC (rev 38) +++ trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 03:24:07 UTC (rev 39) @@ -11,7 +11,6 @@ void PlayState::enter() { - mInputDevice = InputManager::getSingletonPtr()->getInputDevice(); mRoot = Ogre::Root::getSingletonPtr(); mSceneMgr = mRoot->createSceneManager("BspSceneManager"); Modified: trunk/perceptioncrash/src/PlayState.hpp =================================================================== --- trunk/perceptioncrash/src/PlayState.hpp 2006-05-19 02:54:56 UTC (rev 38) +++ trunk/perceptioncrash/src/PlayState.hpp 2006-05-19 03:24:07 UTC (rev 39) @@ -34,7 +34,6 @@ Ogre::Root *mRoot; Ogre::SceneManager* mSceneMgr; Ogre::Viewport* mViewport; - Ogre::InputReader* mInputDevice; Ogre::Camera* mCamera; private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-19 02:55:09
|
Revision: 38 Author: sik0fewl Date: 2006-05-18 19:54:56 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=38&view=rev Log Message: ----------- Moved mouse listener to GameManager class so it can delegate events to the current state Made GameState event functions non-pure virtual so derived classes do not have to implement event handlers they don't want Modified Paths: -------------- trunk/perceptioncrash/src/GameManager.cpp trunk/perceptioncrash/src/GameManager.hpp trunk/perceptioncrash/src/GameState.hpp trunk/perceptioncrash/src/PauseState.cpp trunk/perceptioncrash/src/PlayState.cpp trunk/perceptioncrash/src/PlayState.hpp Modified: trunk/perceptioncrash/src/GameManager.cpp =================================================================== --- trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 00:34:28 UTC (rev 37) +++ trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 02:54:56 UTC (rev 38) @@ -42,6 +42,7 @@ mInputManager = new InputManager(mRoot->getAutoCreatedWindow()); mInputManager->getEventProcessor()->addKeyListener(this); + mInputManager->getEventProcessor()->addMouseMotionListener(this); changeState(state); @@ -173,6 +174,27 @@ mStates.back()->keyReleased(e); } +void +GameManager::mouseMoved(Ogre::MouseEvent* e) +{ + // call mouseMoved of current state + mStates.back()->mouseMoved(e); +} + +void +GameManager::mouseDragged(Ogre::MouseEvent* e) +{ + // call mouseDragged of current state + mStates.back()->mouseDragged(e); +} + +void +GameManager::mouseDragMoved(Ogre::MouseEvent* e) +{ + // call mouseDragMoved of current state + mStates.back()->mouseDragMoved(e); +} + bool GameManager::frameStarted(const Ogre::FrameEvent& evt) { Modified: trunk/perceptioncrash/src/GameManager.hpp =================================================================== --- trunk/perceptioncrash/src/GameManager.hpp 2006-05-19 00:34:28 UTC (rev 37) +++ trunk/perceptioncrash/src/GameManager.hpp 2006-05-19 02:54:56 UTC (rev 38) @@ -12,6 +12,7 @@ class GameManager : public Ogre::FrameListener, public Ogre::KeyListener, + public Ogre::MouseMotionListener, public Ogre::Singleton<GameManager> { public: @@ -38,6 +39,10 @@ void keyPressed(Ogre::KeyEvent* e); void keyReleased(Ogre::KeyEvent* e); + void mouseMoved(Ogre::MouseEvent* e); + void mouseDragged(Ogre::MouseEvent* e); + void mouseDragMoved(Ogre::MouseEvent* e); + bool frameStarted(const Ogre::FrameEvent& evt); bool frameEnded(const Ogre::FrameEvent& evt); Modified: trunk/perceptioncrash/src/GameState.hpp =================================================================== --- trunk/perceptioncrash/src/GameState.hpp 2006-05-19 00:34:28 UTC (rev 37) +++ trunk/perceptioncrash/src/GameState.hpp 2006-05-19 02:54:56 UTC (rev 38) @@ -16,12 +16,20 @@ virtual void pause() = 0; virtual void resume() = 0; - virtual void keyClicked(Ogre::KeyEvent* e) = 0; - virtual void keyPressed(Ogre::KeyEvent* e) = 0; - virtual void keyReleased(Ogre::KeyEvent* e) = 0; - virtual bool frameStarted(const Ogre::FrameEvent& evt) = 0; - virtual bool frameEnded(const Ogre::FrameEvent& evt) = 0; + virtual void keyClicked(Ogre::KeyEvent* e) { } + virtual void keyPressed(Ogre::KeyEvent* e) { } + virtual void keyReleased(Ogre::KeyEvent* e) { } + virtual void mouseMoved(Ogre::MouseEvent* e) { } + virtual void mouseDragged(Ogre::MouseEvent* e) { } + virtual void mouseDragMoved(Ogre::MouseEvent* e) { } + + virtual bool frameStarted(const Ogre::FrameEvent& evt) + { return true; }; + virtual bool frameEnded(const Ogre::FrameEvent& evt) + { return true; }; + + void changeState(GameState* state) { GameManager::getSingletonPtr()->changeState(state); Modified: trunk/perceptioncrash/src/PauseState.cpp =================================================================== --- trunk/perceptioncrash/src/PauseState.cpp 2006-05-19 00:34:28 UTC (rev 37) +++ trunk/perceptioncrash/src/PauseState.cpp 2006-05-19 02:54:56 UTC (rev 38) @@ -12,7 +12,7 @@ mRoot = Ogre::Root::getSingletonPtr(); mViewport = mRoot->getAutoCreatedWindow()->getViewport(0); - mViewport->setBackgroundColour( Ogre::ColourValue(0.0, 1.0, 0.0) ); + mViewport->setBackgroundColour(Ogre::ColourValue(0.0, 1.0, 0.0)); } void Modified: trunk/perceptioncrash/src/PlayState.cpp =================================================================== --- trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 00:34:28 UTC (rev 37) +++ trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 02:54:56 UTC (rev 38) @@ -17,7 +17,7 @@ mSceneMgr = mRoot->createSceneManager("BspSceneManager"); mCamera = mSceneMgr->createCamera("PlayCamera"); mViewport = mRoot->getAutoCreatedWindow()->addViewport(mCamera); - mViewport->setBackgroundColour( Ogre::ColourValue(0.3, 0.3, 0.3) ); + mViewport->setBackgroundColour(Ogre::ColourValue(0.3, 0.3, 0.3)); mCamera->setNearClipDistance(5.0f); mCamera->setFarClipDistance(5000.0f); @@ -25,22 +25,20 @@ Ogre::Real(mViewport->getActualHeight())); Ogre::ResourceGroupManager* rgm = Ogre::ResourceGroupManager::getSingletonPtr(); - rgm->linkWorldGeometryToResourceGroup(rgm->getWorldResourceGroupName(), + rgm->linkWorldGeometryToResourceGroup(rgm->getWorldResourceGroupName(), "ogretestmap.bsp", mSceneMgr); // sdw: This line causes me to crash, i don't know why. It works fine in another // project, and used to in this one, until something must have changed. - //rgm->loadResourceGroup(rgm->getWorldResourceGroupName(), false, true); - mSceneMgr->setAmbientLight( Ogre::ColourValue(1, 1, 1) ); + rgm->loadResourceGroup(rgm->getWorldResourceGroupName(), false, true); + mSceneMgr->setAmbientLight(Ogre::ColourValue(1, 1, 1)); Ogre::ViewPoint vp = mSceneMgr->getSuggestedViewpoint(true); mCamera->setPosition(vp.position); - mCamera->pitch( Ogre::Degree(90) ); + mCamera->pitch(Ogre::Degree(90)); mCamera->rotate(vp.orientation); mCamera->setFixedYawAxis(true, Ogre::Vector3::UNIT_Z); - - InputManager::getSingleton().getEventProcessor()->addMouseMotionListener( this ); } void @@ -49,7 +47,6 @@ mSceneMgr->clearScene(); mSceneMgr->destroyAllCameras(); mRoot->getAutoCreatedWindow()->removeAllViewports(); - InputManager::getSingleton().getEventProcessor()->removeMouseMotionListener( this ); } void @@ -60,7 +57,7 @@ void PlayState::resume() { - mViewport->setBackgroundColour( Ogre::ColourValue(0.3, 0.3, 0.3) ); + mViewport->setBackgroundColour(Ogre::ColourValue(0.3, 0.3, 0.3)); } void @@ -102,8 +99,8 @@ void PlayState::mouseMoved(Ogre::MouseEvent *e) { - mCamera->yaw( Ogre::Radian(-e->getRelX() * 1.f) ); - mCamera->pitch( Ogre::Radian(-e->getRelY() * 1.f) ); + mCamera->yaw(Ogre::Radian(-e->getRelX() * 1.f)); + mCamera->pitch(Ogre::Radian(-e->getRelY() * 1.f)); } void Modified: trunk/perceptioncrash/src/PlayState.hpp =================================================================== --- trunk/perceptioncrash/src/PlayState.hpp 2006-05-19 00:34:28 UTC (rev 37) +++ trunk/perceptioncrash/src/PlayState.hpp 2006-05-19 02:54:56 UTC (rev 38) @@ -5,8 +5,7 @@ #include "GameState.hpp" -class PlayState : public GameState, - public Ogre::MouseMotionListener +class PlayState : public GameState { public: void enter(); @@ -18,14 +17,15 @@ void keyClicked(Ogre::KeyEvent* e); void keyPressed(Ogre::KeyEvent* e); void keyReleased(Ogre::KeyEvent* e); + + void mouseMoved(Ogre::MouseEvent* e); + void mouseDragged(Ogre::MouseEvent* e); + void mouseDragMoved(Ogre::MouseEvent* e); + bool frameStarted(const Ogre::FrameEvent& evt); bool frameEnded(const Ogre::FrameEvent& evt); - void mouseMoved(Ogre::MouseEvent *); - void mouseDragged(Ogre::MouseEvent *); - void mouseDragMoved(Ogre::MouseEvent *); - - static PlayState* getInstance() + static PlayState* getInstance() { return &mPlayState; } protected: @@ -36,7 +36,7 @@ Ogre::Viewport* mViewport; Ogre::InputReader* mInputDevice; Ogre::Camera* mCamera; - + private: static PlayState mPlayState; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-19 00:34:35
|
Revision: 37 Author: sik0fewl Date: 2006-05-18 17:34:28 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=37&view=rev Log Message: ----------- Moving VC++ project files into contrib/ where they belong Removed root bin directory.. that doesn't belong there Added Paths: ----------- trunk/perceptioncrash/contrib/ trunk/perceptioncrash/contrib/VC++Project/ trunk/perceptioncrash/contrib/VC++Project/perceptioncrash/ Removed Paths: ------------- trunk/perceptioncrash/VC++Project/ trunk/perceptioncrash/bin/ trunk/perceptioncrash/contrib/VC++Project/perceptioncrash/ Copied: trunk/perceptioncrash/contrib/VC++Project (from rev 34, trunk/perceptioncrash/VC++Project) Copied: trunk/perceptioncrash/contrib/VC++Project/perceptioncrash (from rev 36, trunk/perceptioncrash/VC++Project/perceptioncrash) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <xs...@us...> - 2006-05-19 00:06:23
|
Revision: 36 Author: xsdwx Date: 2006-05-18 17:06:12 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=36&view=rev Log Message: ----------- no more using namespace Ogre;, freelook camera added, bsp level does not render correctly Modified Paths: -------------- trunk/perceptioncrash/src/GameManager.cpp trunk/perceptioncrash/src/InputManager.hpp trunk/perceptioncrash/src/IntroState.cpp trunk/perceptioncrash/src/PauseState.cpp trunk/perceptioncrash/src/PlayState.cpp trunk/perceptioncrash/src/PlayState.hpp Removed Paths: ------------- trunk/perceptioncrash/SConstruct Deleted: trunk/perceptioncrash/SConstruct =================================================================== --- trunk/perceptioncrash/SConstruct 2006-05-18 23:02:04 UTC (rev 35) +++ trunk/perceptioncrash/SConstruct 2006-05-19 00:06:12 UTC (rev 36) @@ -1,23 +0,0 @@ -# SCons build file for Linux - -import glob - -# create build environment -env = Environment() - -# Get library flags -env.ParseConfig('pkg-config --cflags --libs OGRE') -env.ParseConfig('pkg-config --cflags --libs CEGUI') - -# gather a list of source files -SOURCES = glob.glob('src/*.cpp') - -# add additional compiler flags -env.Append(CCFLAGS = ['-g', '-Wall']) - -# add additional libraries to link against -env.Append(LIBS = ['CEGUIOgreRenderer']) - -# build target -# output executable will be "game" -env.Program(target = 'perceptioncrash', source = SOURCES) Modified: trunk/perceptioncrash/src/GameManager.cpp =================================================================== --- trunk/perceptioncrash/src/GameManager.cpp 2006-05-18 23:02:04 UTC (rev 35) +++ trunk/perceptioncrash/src/GameManager.cpp 2006-05-19 00:06:12 UTC (rev 36) @@ -4,10 +4,8 @@ #include "InputManager.hpp" #include "GameState.hpp" -using namespace Ogre; +template<> GameManager* Ogre::Singleton<GameManager>::ms_Singleton = 0; -template<> GameManager* Singleton<GameManager>::ms_Singleton = 0; - GameManager::GameManager() { mRoot = 0; @@ -33,7 +31,7 @@ void GameManager::start(GameState* state) { - mRoot = new Root(); + mRoot = new Ogre::Root(); setupResources(); @@ -101,20 +99,11 @@ { // This is all temporary stuff Ogre::ResourceGroupManager* rgm = Ogre::ResourceGroupManager::getSingletonPtr(); - rgm->addResourceLocation("../../data/objects", "FileSystem", "General"); - rgm->addResourceLocation("../../data/images", "FileSystem", "General"); - rgm->addResourceLocation("../../data/packs/OgreCore.zip", "Zip", "General"); + rgm->addResourceLocation("data/objects", "FileSystem", "General"); + rgm->addResourceLocation("data/images", "FileSystem", "General"); + rgm->addResourceLocation("data/packs/OgreCore.zip", "Zip", "General"); + rgm->addResourceLocation("data/maps/ogretestmap.zip", "Zip", rgm->getWorldResourceGroupName()); - //rgm->addResourceLocation("data/maps/ogretestmap.zip", "Zip", - // rgm->getWorldResourceGroupName()); - - //rgm->linkWorldGeometryToResourceGroup(rgm->getWorldResourceGroupName(), - // "ogretestmap.bsp", - // mSceneMgr); - - //rgm->initialiseAllResourceGroups(); - //rgm->loadResourceGroup(rgm->getWorldResourceGroupName(), false, true); - #if 0 // load resource paths from config file ConfigFile cf; @@ -143,7 +132,7 @@ #endif } -bool GameManager::configure(void) +bool GameManager::configure() { // load config settings from ogre.cfg if (!mRoot->restoreConfig()) @@ -158,54 +147,54 @@ // initialise and create a default rendering window mRenderWindow = mRoot->initialise(true); - ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); + Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); return true; } void -GameManager::keyClicked(KeyEvent* e) +GameManager::keyClicked(Ogre::KeyEvent* e) { // call keyClicked of current state mStates.back()->keyClicked(e); } void -GameManager::keyPressed(KeyEvent* e) +GameManager::keyPressed(Ogre::KeyEvent* e) { // call keyPressed of current state mStates.back()->keyPressed(e); } void -GameManager::keyReleased(KeyEvent* e) +GameManager::keyReleased(Ogre::KeyEvent* e) { // call keyReleased of current state mStates.back()->keyReleased(e); } bool -GameManager::frameStarted(const FrameEvent& evt) +GameManager::frameStarted(const Ogre::FrameEvent& evt) { // call frameStarted of current state return mStates.back()->frameStarted(evt); } bool -GameManager::frameEnded(const FrameEvent& evt) +GameManager::frameEnded(const Ogre::FrameEvent& evt) { // call frameEnded of current state return mStates.back()->frameEnded(evt); } GameManager* -GameManager::getSingletonPtr(void) +GameManager::getSingletonPtr() { return ms_Singleton; } GameManager& -GameManager::getSingleton(void) +GameManager::getSingleton() { assert(ms_Singleton); return *ms_Singleton; Modified: trunk/perceptioncrash/src/InputManager.hpp =================================================================== --- trunk/perceptioncrash/src/InputManager.hpp 2006-05-18 23:02:04 UTC (rev 35) +++ trunk/perceptioncrash/src/InputManager.hpp 2006-05-19 00:06:12 UTC (rev 36) @@ -10,9 +10,9 @@ InputManager(Ogre::RenderWindow* rwindow); virtual ~InputManager(); - inline Ogre::InputReader* getInputDevice() const + Ogre::InputReader* getInputDevice() const { return mInputDevice; } - inline Ogre::EventProcessor* getEventProcessor() const + Ogre::EventProcessor* getEventProcessor() const { return mEventProcessor; } static InputManager& getSingleton(void); Modified: trunk/perceptioncrash/src/IntroState.cpp =================================================================== --- trunk/perceptioncrash/src/IntroState.cpp 2006-05-18 23:02:04 UTC (rev 35) +++ trunk/perceptioncrash/src/IntroState.cpp 2006-05-19 00:06:12 UTC (rev 36) @@ -4,22 +4,20 @@ #include "IntroState.hpp" #include "PlayState.hpp" -using namespace Ogre; - IntroState IntroState::mIntroState; void IntroState::enter() { mInputDevice = InputManager::getSingletonPtr()->getInputDevice(); - mRoot = Root::getSingletonPtr(); + mRoot = Ogre::Root::getSingletonPtr(); - mSceneMgr = mRoot->createSceneManager(ST_GENERIC); + mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC); mCamera = mSceneMgr->createCamera("IntroCamera"); mViewport = mRoot->getAutoCreatedWindow()->addViewport(mCamera); - mViewport->setBackgroundColour(ColourValue(1.0, 1.0, 1.0)); + mViewport->setBackgroundColour( Ogre::ColourValue(1.0, 1.0, 1.0) ); - mLogoOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay"); + mLogoOverlay = Ogre::OverlayManager::getSingleton().getByName("Core/DebugOverlay"); if (mLogoOverlay) mLogoOverlay->show(); @@ -31,7 +29,7 @@ { mSceneMgr->clearScene(); mSceneMgr->destroyAllCameras(); - mRoot->getAutoCreatedWindow()->removeAllViewports(); + mRoot->getAutoCreatedWindow()->removeAllViewports(); } void @@ -45,37 +43,37 @@ } void -IntroState::keyClicked(KeyEvent* e) +IntroState::keyClicked(Ogre::KeyEvent* e) { } void -IntroState::keyPressed(KeyEvent* e) +IntroState::keyPressed(Ogre::KeyEvent* e) { - if (e->getKey() == KC_SPACE) + if (e->getKey() == Ogre::KC_SPACE) { changeState(PlayState::getInstance()); } - if (e->getKey() == KC_ESCAPE) + if (e->getKey() == Ogre::KC_ESCAPE) { mExitGame = true; } } void -IntroState::keyReleased(KeyEvent* e) +IntroState::keyReleased(Ogre::KeyEvent* e) { } bool -IntroState::frameStarted(const FrameEvent& evt) +IntroState::frameStarted(const Ogre::FrameEvent& evt) { return true; } bool -IntroState::frameEnded(const FrameEvent& evt) +IntroState::frameEnded(const Ogre::FrameEvent& evt) { if (mExitGame) return false; Modified: trunk/perceptioncrash/src/PauseState.cpp =================================================================== --- trunk/perceptioncrash/src/PauseState.cpp 2006-05-18 23:02:04 UTC (rev 35) +++ trunk/perceptioncrash/src/PauseState.cpp 2006-05-19 00:06:12 UTC (rev 36) @@ -3,18 +3,16 @@ #include "PauseState.hpp" #include "PlayState.hpp" -using namespace Ogre; - PauseState PauseState::mPauseState; void PauseState::enter() { mInputDevice = InputManager::getSingletonPtr()->getInputDevice(); - mRoot = Root::getSingletonPtr(); + mRoot = Ogre::Root::getSingletonPtr(); mViewport = mRoot->getAutoCreatedWindow()->getViewport(0); - mViewport->setBackgroundColour(ColourValue(0.0, 1.0, 0.0)); + mViewport->setBackgroundColour( Ogre::ColourValue(0.0, 1.0, 0.0) ); } void @@ -33,32 +31,32 @@ } void -PauseState::keyClicked(KeyEvent* e) +PauseState::keyClicked(Ogre::KeyEvent* e) { } void -PauseState::keyPressed(KeyEvent* e) +PauseState::keyPressed(Ogre::KeyEvent* e) { - if (e->getKey() == KC_P) + if (e->getKey() == Ogre::KC_P) { popState(); } } void -PauseState::keyReleased(KeyEvent* e) +PauseState::keyReleased(Ogre::KeyEvent* e) { } bool -PauseState::frameStarted(const FrameEvent& evt) +PauseState::frameStarted(const Ogre::FrameEvent& evt) { return true; } bool -PauseState::frameEnded(const FrameEvent& evt) +PauseState::frameEnded(const Ogre::FrameEvent& evt) { return true; } Modified: trunk/perceptioncrash/src/PlayState.cpp =================================================================== --- trunk/perceptioncrash/src/PlayState.cpp 2006-05-18 23:02:04 UTC (rev 35) +++ trunk/perceptioncrash/src/PlayState.cpp 2006-05-19 00:06:12 UTC (rev 36) @@ -1,23 +1,46 @@ #include <OgreKeyEvent.h> +#include "InputManager.hpp" + #include "PlayState.hpp" #include "IntroState.hpp" #include "PauseState.hpp" -using namespace Ogre; - PlayState PlayState::mPlayState; void PlayState::enter() { mInputDevice = InputManager::getSingletonPtr()->getInputDevice(); - mRoot = Root::getSingletonPtr(); + mRoot = Ogre::Root::getSingletonPtr(); - mSceneMgr = mRoot->createSceneManager(ST_GENERIC); + mSceneMgr = mRoot->createSceneManager("BspSceneManager"); mCamera = mSceneMgr->createCamera("PlayCamera"); mViewport = mRoot->getAutoCreatedWindow()->addViewport(mCamera); - mViewport->setBackgroundColour(ColourValue(0.3, 0.3, 0.3)); + mViewport->setBackgroundColour( Ogre::ColourValue(0.3, 0.3, 0.3) ); + + mCamera->setNearClipDistance(5.0f); + mCamera->setFarClipDistance(5000.0f); + mCamera->setAspectRatio(Ogre::Real(mViewport->getActualWidth()) / + Ogre::Real(mViewport->getActualHeight())); + + Ogre::ResourceGroupManager* rgm = Ogre::ResourceGroupManager::getSingletonPtr(); + rgm->linkWorldGeometryToResourceGroup(rgm->getWorldResourceGroupName(), + "ogretestmap.bsp", + mSceneMgr); + + // sdw: This line causes me to crash, i don't know why. It works fine in another + // project, and used to in this one, until something must have changed. + //rgm->loadResourceGroup(rgm->getWorldResourceGroupName(), false, true); + mSceneMgr->setAmbientLight( Ogre::ColourValue(1, 1, 1) ); + + Ogre::ViewPoint vp = mSceneMgr->getSuggestedViewpoint(true); + mCamera->setPosition(vp.position); + mCamera->pitch( Ogre::Degree(90) ); + mCamera->rotate(vp.orientation); + mCamera->setFixedYawAxis(true, Ogre::Vector3::UNIT_Z); + + InputManager::getSingleton().getEventProcessor()->addMouseMotionListener( this ); } void @@ -26,6 +49,7 @@ mSceneMgr->clearScene(); mSceneMgr->destroyAllCameras(); mRoot->getAutoCreatedWindow()->removeAllViewports(); + InputManager::getSingleton().getEventProcessor()->removeMouseMotionListener( this ); } void @@ -36,41 +60,58 @@ void PlayState::resume() { - mViewport->setBackgroundColour(ColourValue(0.3, 0.3, 0.3)); + mViewport->setBackgroundColour( Ogre::ColourValue(0.3, 0.3, 0.3) ); } void -PlayState::keyClicked(KeyEvent* e) +PlayState::keyClicked(Ogre::KeyEvent* e) { } void -PlayState::keyPressed(KeyEvent* e) +PlayState::keyPressed(Ogre::KeyEvent* e) { - if (e->getKey() == KC_P) + if (e->getKey() == Ogre::KC_P) { pushState(PauseState::getInstance()); } - if (e->getKey() == KC_ESCAPE) + if (e->getKey() == Ogre::KC_ESCAPE) { changeState(IntroState::getInstance()); } } void -PlayState::keyReleased(KeyEvent* e) +PlayState::keyReleased(Ogre::KeyEvent* e) { } bool -PlayState::frameStarted(const FrameEvent& evt) +PlayState::frameStarted(const Ogre::FrameEvent& evt) { return true; } bool -PlayState::frameEnded(const FrameEvent& evt) +PlayState::frameEnded(const Ogre::FrameEvent& evt) { return true; } + +void +PlayState::mouseMoved(Ogre::MouseEvent *e) +{ + mCamera->yaw( Ogre::Radian(-e->getRelX() * 1.f) ); + mCamera->pitch( Ogre::Radian(-e->getRelY() * 1.f) ); +} + +void +PlayState::mouseDragged(Ogre::MouseEvent *e) +{ +} + +void +PlayState::mouseDragMoved(Ogre::MouseEvent *e) +{ +} Modified: trunk/perceptioncrash/src/PlayState.hpp =================================================================== --- trunk/perceptioncrash/src/PlayState.hpp 2006-05-18 23:02:04 UTC (rev 35) +++ trunk/perceptioncrash/src/PlayState.hpp 2006-05-19 00:06:12 UTC (rev 36) @@ -5,7 +5,8 @@ #include "GameState.hpp" -class PlayState : public GameState +class PlayState : public GameState, + public Ogre::MouseMotionListener { public: void enter(); @@ -20,6 +21,10 @@ bool frameStarted(const Ogre::FrameEvent& evt); bool frameEnded(const Ogre::FrameEvent& evt); + void mouseMoved(Ogre::MouseEvent *); + void mouseDragged(Ogre::MouseEvent *); + void mouseDragMoved(Ogre::MouseEvent *); + static PlayState* getInstance() { return &mPlayState; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <sik...@us...> - 2006-05-18 23:02:11
|
Revision: 35 Author: sik0fewl Date: 2006-05-18 16:02:04 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=35&view=rev Log Message: ----------- Added intellisense file to ignore Property Changed: ---------------- trunk/perceptioncrash/VC++Project/perceptioncrash/ Property changes on: trunk/perceptioncrash/VC++Project/perceptioncrash ___________________________________________________________________ Name: svn:ignore + perceptioncrash.ncb This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <wor...@us...> - 2006-05-18 21:24:22
|
Revision: 34 Author: workmad3 Date: 2006-05-18 14:24:10 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=34&view=rev Log Message: ----------- build directories are bin/debug for debug builds and bin/release for release builds. The hard coded resource paths for the data directory are relative to these directories. VC++ project is now set up to build into these directories automatically. Modified Paths: -------------- trunk/perceptioncrash/VC++Project/perceptioncrash/perceptioncrash.vcproj trunk/perceptioncrash/src/GameManager.cpp Added Paths: ----------- trunk/perceptioncrash/bin/ trunk/perceptioncrash/bin/debug/ trunk/perceptioncrash/bin/release/ Modified: trunk/perceptioncrash/VC++Project/perceptioncrash/perceptioncrash.vcproj =================================================================== --- trunk/perceptioncrash/VC++Project/perceptioncrash/perceptioncrash.vcproj 2006-05-18 20:59:17 UTC (rev 33) +++ trunk/perceptioncrash/VC++Project/perceptioncrash/perceptioncrash.vcproj 2006-05-18 21:24:10 UTC (rev 34) @@ -63,7 +63,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="OgreMain_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib" - OutputFile="$(OutDir)\$(ProjectName).exe" + OutputFile="..\..\bin\debug\$(ProjectName).exe" LinkIncremental="2" AdditionalLibraryDirectories="$(OGRE_HOME)\lib" GenerateDebugInformation="true" @@ -94,8 +94,8 @@ /> <Tool Name="VCPostBuildEventTool" - Description="Copying exe to samples bin directory ..." - CommandLine="copy "$(OutDir)\$(TargetFileName)" "$(OGRE_HOME)\Bin\$(ConfigurationName)"" + Description="" + CommandLine="" /> </Configuration> <Configuration @@ -147,7 +147,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib" - OutputFile="$(OutDir)\$(ProjectName).exe" + OutputFile="..\..\bin\release\$(ProjectName).exe" LinkIncremental="1" AdditionalLibraryDirectories="$(OGRE_HOME)\lib" GenerateDebugInformation="true" @@ -179,8 +179,8 @@ /> <Tool Name="VCPostBuildEventTool" - Description="Copying exe to samples bin directory ..." - CommandLine="copy "$(OutDir)\$(TargetFileName)" "$(OGRE_HOME)\Bin\$(ConfigurationName)"" + Description="" + CommandLine="" /> </Configuration> </Configurations> Modified: trunk/perceptioncrash/src/GameManager.cpp =================================================================== --- trunk/perceptioncrash/src/GameManager.cpp 2006-05-18 20:59:17 UTC (rev 33) +++ trunk/perceptioncrash/src/GameManager.cpp 2006-05-18 21:24:10 UTC (rev 34) @@ -101,9 +101,9 @@ { // This is all temporary stuff Ogre::ResourceGroupManager* rgm = Ogre::ResourceGroupManager::getSingletonPtr(); - rgm->addResourceLocation("data/objects", "FileSystem", "General"); - rgm->addResourceLocation("data/images", "FileSystem", "General"); - rgm->addResourceLocation("data/packs/OgreCore.zip", "Zip", "General"); + rgm->addResourceLocation("../../data/objects", "FileSystem", "General"); + rgm->addResourceLocation("../../data/images", "FileSystem", "General"); + rgm->addResourceLocation("../../data/packs/OgreCore.zip", "Zip", "General"); //rgm->addResourceLocation("data/maps/ogretestmap.zip", "Zip", // rgm->getWorldResourceGroupName()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <wor...@us...> - 2006-05-18 20:44:38
|
Revision: 32 Author: workmad3 Date: 2006-05-18 13:39:29 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=32&view=rev Log Message: ----------- Modified Paths: -------------- trunk/perceptioncrash/VC++Project/perceptioncrash/perceptioncrash.ncb trunk/perceptioncrash/VC++Project/perceptioncrash/perceptioncrash.vcproj trunk/perceptioncrash/src/PauseState.cpp trunk/perceptioncrash/src/PauseState.hpp trunk/perceptioncrash/src/PlayState.cpp trunk/perceptioncrash/src/PlayState.hpp Modified: trunk/perceptioncrash/VC++Project/perceptioncrash/perceptioncrash.ncb =================================================================== --- trunk/perceptioncrash/VC++Project/perceptioncrash/perceptioncrash.ncb 2006-05-18 20:04:05 UTC (rev 31) +++ trunk/perceptioncrash/VC++Project/perceptioncrash/perceptioncrash.ncb 2006-05-18 20:39:29 UTC (rev 32) @@ -1,950 +1,234 @@ Microsoft C/C++ MSF 7.00 -DS |
|
From: <xs...@us...> - 2006-05-18 20:04:14
|
Revision: 31 Author: xsdwx Date: 2006-05-18 13:04:05 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=31&view=rev Log Message: ----------- Added Paths: ----------- trunk/perceptioncrash/src/PauseState.cpp trunk/perceptioncrash/src/PauseState.hpp trunk/perceptioncrash/src/PlayState.cpp trunk/perceptioncrash/src/PlayState.hpp Added: trunk/perceptioncrash/src/PauseState.cpp =================================================================== --- trunk/perceptioncrash/src/PauseState.cpp (rev 0) +++ trunk/perceptioncrash/src/PauseState.cpp 2006-05-18 20:04:05 UTC (rev 31) @@ -0,0 +1,65 @@ +#include <OGRE/Ogre.h> +#include <OGRE/OgreKeyEvent.h> + +#include "PauseState.hpp" +#include "PlayState.hpp" + +using namespace Ogre; + +PauseState PauseState::mPauseState; + +void +PauseState::enter() +{ + mInputDevice = InputManager::getSingletonPtr()->getInputDevice(); + mRoot = Root::getSingletonPtr(); + + mViewport = mRoot->getAutoCreatedWindow()->getViewport(0); + mViewport->setBackgroundColour(ColourValue(0.0, 1.0, 0.0)); +} + +void +PauseState::exit() +{ +} + +void +PauseState::pause() +{ +} + +void +PauseState::resume() +{ +} + +void +PauseState::keyClicked(KeyEvent* e) +{ +} + +void +PauseState::keyPressed(KeyEvent* e) +{ + if (e->getKey() == KC_P) + { + popState(); + } +} + +void +PauseState::keyReleased(KeyEvent* e) +{ +} + +bool +PauseState::frameStarted(const FrameEvent& evt) +{ + return true; +} + +bool +PauseState::frameEnded(const FrameEvent& evt) +{ + return true; +} Added: trunk/perceptioncrash/src/PauseState.hpp =================================================================== --- trunk/perceptioncrash/src/PauseState.hpp (rev 0) +++ trunk/perceptioncrash/src/PauseState.hpp 2006-05-18 20:04:05 UTC (rev 31) @@ -0,0 +1,38 @@ +#ifndef PC_PAUSE_STATE_HPP +#define PC_PAUSE_STATE_HPP + +#include <OGRE/Ogre.h> + +#include "GameState.hpp" + +class PauseState : public GameState +{ +public: + void enter(); + void exit(); + + void pause(); + void resume(); + + void keyClicked(Ogre::KeyEvent* e); + void keyPressed(Ogre::KeyEvent* e); + void keyReleased(Ogre::KeyEvent* e); + bool frameStarted(const Ogre::FrameEvent& evt); + bool frameEnded(const Ogre::FrameEvent& evt); + + static PauseState* getInstance() { return &mPauseState; } + +protected: + PauseState() { } + + Ogre::Root *mRoot; + Ogre::SceneManager* mSceneMgr; + Ogre::Viewport* mViewport; + Ogre::InputReader* mInputDevice; + Ogre::Camera* mCamera; + +private: + static PauseState mPauseState; +}; + +#endif /* PC_PAUSE_STATE_HPP */ Added: trunk/perceptioncrash/src/PlayState.cpp =================================================================== --- trunk/perceptioncrash/src/PlayState.cpp (rev 0) +++ trunk/perceptioncrash/src/PlayState.cpp 2006-05-18 20:04:05 UTC (rev 31) @@ -0,0 +1,77 @@ +#include <OGRE/Ogre.h> +#include <OGRE/OgreKeyEvent.h> + +#include "PlayState.hpp" +#include "IntroState.hpp" +#include "PauseState.hpp" + +using namespace Ogre; + +PlayState PlayState::mPlayState; + +void +PlayState::enter() +{ + mInputDevice = InputManager::getSingletonPtr()->getInputDevice(); + mRoot = Root::getSingletonPtr(); + + mSceneMgr = mRoot->createSceneManager(ST_GENERIC); + mCamera = mSceneMgr->createCamera("PlayCamera"); + mViewport = mRoot->getAutoCreatedWindow()->addViewport(mCamera); + mViewport->setBackgroundColour(ColourValue(0.3, 0.3, 0.3)); +} + +void +PlayState::exit() +{ + mSceneMgr->clearScene(); + mSceneMgr->destroyAllCameras(); + mRoot->getAutoCreatedWindow()->removeAllViewports(); +} + +void +PlayState::pause() +{ +} + +void +PlayState::resume() +{ + mViewport->setBackgroundColour(ColourValue(0.3, 0.3, 0.3)); +} + +void +PlayState::keyClicked(KeyEvent* e) +{ +} + +void +PlayState::keyPressed(KeyEvent* e) +{ + if (e->getKey() == KC_P) + { + pushState(PauseState::getInstance()); + } + + if (e->getKey() == KC_ESCAPE) + { + changeState(IntroState::getInstance()); + } +} + +void +PlayState::keyReleased(KeyEvent* e) +{ +} + +bool +PlayState::frameStarted(const FrameEvent& evt) +{ + return true; +} + +bool +PlayState::frameEnded(const FrameEvent& evt) +{ + return true; +} Added: trunk/perceptioncrash/src/PlayState.hpp =================================================================== --- trunk/perceptioncrash/src/PlayState.hpp (rev 0) +++ trunk/perceptioncrash/src/PlayState.hpp 2006-05-18 20:04:05 UTC (rev 31) @@ -0,0 +1,39 @@ +#ifndef PC_PLAY_STATE_HPP +#define PC_PLAY_STATE_HPP + +#include <OGRE/Ogre.h> + +#include "GameState.hpp" + +class PlayState : public GameState +{ +public: + void enter(); + void exit(); + + void pause(); + void resume(); + + void keyClicked(Ogre::KeyEvent* e); + void keyPressed(Ogre::KeyEvent* e); + void keyReleased(Ogre::KeyEvent* e); + bool frameStarted(const Ogre::FrameEvent& evt); + bool frameEnded(const Ogre::FrameEvent& evt); + + static PlayState* getInstance() + { return &mPlayState; } + +protected: + PlayState() { } + + Ogre::Root *mRoot; + Ogre::SceneManager* mSceneMgr; + Ogre::Viewport* mViewport; + Ogre::InputReader* mInputDevice; + Ogre::Camera* mCamera; + +private: + static PlayState mPlayState; +}; + +#endif /* PC_PLAY_STATE_HPP */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <xs...@us...> - 2006-05-18 20:03:00
|
Revision: 30 Author: xsdwx Date: 2006-05-18 13:02:52 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/perceptioncrash/?rev=30&view=rev Log Message: ----------- Modified Paths: -------------- trunk/perceptioncrash/src/GameManager.hpp trunk/perceptioncrash/src/GameState.hpp trunk/perceptioncrash/src/InputManager.cpp trunk/perceptioncrash/src/InputManager.hpp trunk/perceptioncrash/src/IntroState.cpp trunk/perceptioncrash/src/IntroState.hpp trunk/perceptioncrash/src/main.cpp Modified: trunk/perceptioncrash/src/GameManager.hpp =================================================================== --- trunk/perceptioncrash/src/GameManager.hpp 2006-05-18 19:04:28 UTC (rev 29) +++ trunk/perceptioncrash/src/GameManager.hpp 2006-05-18 20:02:52 UTC (rev 30) @@ -45,4 +45,4 @@ std::vector<GameState*> mStates; }; -#endif /*PC_GAME_MANAGER */ +#endif /* PC_GAME_MANAGER */ Modified: trunk/perceptioncrash/src/GameState.hpp =================================================================== --- trunk/perceptioncrash/src/GameState.hpp 2006-05-18 19:04:28 UTC (rev 29) +++ trunk/perceptioncrash/src/GameState.hpp 2006-05-18 20:02:52 UTC (rev 30) @@ -40,4 +40,4 @@ GameState() { } }; -#endif /*PC_GAME_STATE_HPP */ +#endif /* PC_GAME_STATE_HPP */ Modified: trunk/perceptioncrash/src/InputManager.cpp =================================================================== --- trunk/perceptioncrash/src/InputManager.cpp 2006-05-18 19:04:28 UTC (rev 29) +++ trunk/perceptioncrash/src/InputManager.cpp 2006-05-18 20:02:52 UTC (rev 30) @@ -1,4 +1,5 @@ #include <OgreEventProcessor.h> +#include <OgrePlatformManager.h> #include "InputManager.hpp" @@ -9,7 +10,9 @@ mEventProcessor = new Ogre::EventProcessor(); mEventProcessor->initialise(window); mEventProcessor->startProcessingEvents(); - mInputDevice = mEventProcessor->getInputReader(); + + mInputDevice = Ogre::PlatformManager::getSingleton().createInputReader(); + mInputDevice->initialise(window, true, true); } InputManager::~InputManager() Modified: trunk/perceptioncrash/src/InputManager.hpp =================================================================== --- trunk/perceptioncrash/src/InputManager.hpp 2006-05-18 19:04:28 UTC (rev 29) +++ trunk/perceptioncrash/src/InputManager.hpp 2006-05-18 20:02:52 UTC (rev 30) @@ -23,4 +23,4 @@ Ogre::InputReader* mInputDevice; }; -#endif /*PC_INPUT_MANAGER_HPP */ +#endif /* PC_INPUT_MANAGER_HPP */ Modified: trunk/perceptioncrash/src/IntroState.cpp =================================================================== --- trunk/perceptioncrash/src/IntroState.cpp 2006-05-18 19:04:28 UTC (rev 29) +++ trunk/perceptioncrash/src/IntroState.cpp 2006-05-18 20:02:52 UTC (rev 30) @@ -2,7 +2,7 @@ #include <OgreKeyEvent.h> #include "IntroState.hpp" -//#include "PlayState.hpp" +#include "PlayState.hpp" using namespace Ogre; @@ -17,7 +17,7 @@ mSceneMgr = mRoot->createSceneManager(ST_GENERIC); mCamera = mSceneMgr->createCamera("IntroCamera"); mViewport = mRoot->getAutoCreatedWindow()->addViewport(mCamera); - mViewport->setBackgroundColour(ColourValue(1.0, 0.0, 0.0)); + mViewport->setBackgroundColour(ColourValue(1.0, 1.0, 1.0)); mLogoOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay"); if (mLogoOverlay) @@ -54,7 +54,7 @@ { if (e->getKey() == KC_SPACE) { - //changeState(PlayState::getInstance()); + changeState(PlayState::getInstance()); } if (e->getKey() == KC_ESCAPE) Modified: trunk/perceptioncrash/src/IntroState.hpp =================================================================== --- trunk/perceptioncrash/src/IntroState.hpp 2006-05-18 19:04:28 UTC (rev 29) +++ trunk/perceptioncrash/src/IntroState.hpp 2006-05-18 20:02:52 UTC (rev 30) @@ -42,4 +42,4 @@ static IntroState mIntroState; }; -#endif /*PC_INTRO_STATE*/ +#endif /* PC_INTRO_STATE_HPP */ Modified: trunk/perceptioncrash/src/main.cpp =================================================================== --- trunk/perceptioncrash/src/main.cpp 2006-05-18 19:04:28 UTC (rev 29) +++ trunk/perceptioncrash/src/main.cpp 2006-05-18 20:02:52 UTC (rev 30) @@ -3,8 +3,6 @@ #include <Ogre.h> #include <OgreErrorDialog.h> -#include "Game.hpp" - #include "GameManager.hpp" #include "IntroState.hpp" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |