Commit Graph

319 Commits (d25d6124a9633a2535a20abc358c99ac44d384e1)

Author SHA1 Message Date
Piotr Dziwinski 61a3ba2800 Fix undefined function colobot-lint issues 2015-09-29 21:44:24 +02:00
krzys-h 2cb2782c9d Restored old Ceebot-Teen objects
In preparations for new programming course
2015-09-28 22:08:59 +02:00
krzys-h ff17961584 Refactored CPauseManager 2015-08-31 21:47:55 +02:00
krzys-h 6711154762 Fixed produce() and NewScript not marking programs as loaded from level files (closes #613); refactored NewScript to std::vector and std::string 2015-08-29 16:52:07 +02:00
krzys-h 06e10a515e Fixed crash when loading SatCom files with both images and code, closes #587 2015-08-25 11:22:35 +02:00
krzys-h 270c77da5b Fixed memory corruption in produce(), closes #600 2015-08-25 10:49:59 +02:00
krzys-h 07141f6d90 Fixed wrong energy level in CBot (mentioned in #601) 2015-08-24 21:14:19 +02:00
Piotr Dziwinski b93f610930 Fix license header in all files 2015-08-22 16:40:02 +02:00
krzys-h d6a946618e Syntax highlighting in SatCom 2015-08-18 22:35:38 +02:00
krzys-h c5da68d516 New CBot syntax highlighting 2015-08-18 22:12:00 +02:00
Piotr Dziwinski a63a959dbe Apply clang-modernize -use-nullptr 2015-08-17 22:40:52 +02:00
krzys-h 1059ae37c1 Shielder subclass 2015-08-17 14:06:31 +02:00
krzys-h 63bee182d2 Moved SetFixed/GetFixed to CBaseAlien 2015-08-17 13:19:21 +02:00
krzys-h ad84478c71 Removed Get/SetInfoReturn 2015-08-17 11:44:05 +02:00
krzys-h 3f303ea824 Removed some unneccessary includes 2015-08-16 16:35:39 +02:00
Piotr Dziwinski 2289d69735 Replace NULL -> nullptr 2015-08-16 12:43:42 +02:00
krzys-h 0eaf0d6f65 Split Programmable and ProgramStorage 2015-08-15 21:29:08 +02:00
krzys-h 856c5baa0e Removed CTaskManager 2015-08-15 20:30:15 +02:00
krzys-h 9a15db1bea Split global.h 2015-08-15 14:02:07 +02:00
Piotr Dziwinski efedb44cce Add proper initializations and remove manual memory management in remaining classes
Except CBot-related stuff of course
2015-08-14 23:44:00 +02:00
Piotr Dziwinski 870f89ac4a Further fixes for GCC 4.7 build 2015-08-14 19:34:17 +02:00
krzys-h 57646c0c7b Refactored object creation 2015-08-14 18:20:44 +02:00
krzys-h 275e792a81 Removed old Scrap objects; cleaned up some more if()'s 2015-08-13 19:41:21 +02:00
krzys-h bfd3a5b23c Refactored ExplodeObject 2015-08-13 18:54:44 +02:00
krzys-h e5e1d4973f CDestroyableObject, CFragileObject, CShieldedObject and CShieldedAutoRegenObject 2015-08-13 13:41:25 +02:00
krzys-h ff957afefc Moved files not directly related to CObject into src/level/ directory 2015-08-13 11:47:32 +02:00
krzys-h e937db94c8 Moved GetPhysics() and GetMotion() to CMovableObject; moved trace drawing to CTraceDrawingObject 2015-08-13 10:49:45 +02:00
krzys-h f7d2f501bb Moved common interface implementations to separate classes
Additionaly, merged all "inappropariate bot" errors into one and renamed ERR_GENERIC -> ERR_UNKNOWN
2015-08-12 16:54:44 +02:00
krzys-h a9673d5f72 Moved StartDetectEffect to CRobotMain 2015-08-11 23:13:57 +02:00
krzys-h 7e18757d29 CScript user pointer cleanup; moved some functions from COldObjectInterface to main CObject
* moved (Get|Set)Clip [renamed to (Get|Set)Collisions], (Get|Set)Team, (Get|Set)Proxy(Activate|Distance) and GetBotVar to main CObject class
* refactored scripting to pass CScript* as the user pointer, removing the need for GetRunScript()
* changed accessing of "object" class in CBot to use ->GetUserPtr()
* refactored object limits to remove (Start|Stop)ShowLimit from COldObject
* added notes on possible interfaces for most of the other COldObjectInterface functions
2015-08-11 17:51:39 +02:00
krzys-h 15c1c7ee03 CMovableObject, CControllableObject 2015-08-10 23:21:15 +02:00
krzys-h abb272600e Merged CBrain into CProgrammableObject 2015-08-10 18:16:00 +02:00
krzys-h 2b44a7be3d Removed m_event from script.h 2015-08-10 13:52:03 +02:00
krzys-h 3a5f618f65 CTaskExecutorObject interface; some general task and CBrain cleanup 2015-08-10 13:46:39 +02:00
krzys-h 73e0abc510 Fixed AlienQueen crash 2015-08-10 13:33:11 +02:00
krzys-h e5d652acef Fixed a crash when trying to infect an empty program 2015-08-06 22:50:22 +02:00
Piotr Dziwinski f95980456a Replace anonymous union in Event with pointer to appropriate struct 2015-08-06 19:11:50 +02:00
krzys-h dc85aa2138 Moved all UI controls to a subdirectory 2015-08-06 13:25:24 +02:00
Piotr Dziwinski bdeeaf690b Get rid of memsets 2015-08-06 09:37:25 +02:00
krzys-h 47d79c9977 Added #Include support in level files 2015-08-05 19:27:26 +02:00
krzys-h 72210d523f Fixed this.orientation values outside of 0-360 range 2015-08-03 23:10:24 +02:00
krzys-h 4bdadc8cc8 Updated help file paths 2015-08-03 20:23:35 +02:00
krzys-h 794d1f3cbe Fixed "this" (#547) 2015-08-03 19:56:35 +02:00
Piotr Dziwinski 11b0398c03 Include refactoring
* reordered includes according to correct style
 * removed some unnecessary includes
2015-08-02 17:49:07 +02:00
Piotr Dziwinski 7d8b56d9ab More style fixes 2015-08-02 12:06:14 +02:00
Victor Vieux 7c421b7151 fix highlighting
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-07-29 00:37:56 -07:00
Victor Vieux 38c64940a5 this is not a type
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-07-29 00:37:29 -07:00
MrSimbax d7cdcab2c5 Fix flatspace editor hint 2015-07-27 18:49:02 +02:00
MrSimbax a5d579fc31 Add filter parameter to radar editor hint 2015-07-27 18:12:38 +02:00
krzys-h dfd73118a6 Added flatspace()
Works like space(), but makes sure there is enough flat space for building
2015-07-22 18:26:05 +02:00
krzys-h 59d5545eca Fixed code pause editor bug (#527) 2015-07-22 18:01:24 +02:00
krzys-h 393317fa48 Added researched(), canresearch() and buildingenabled()
closes #524
2015-07-22 17:08:51 +02:00
krzys-h d5d8c0b29f Removed the need for progfunc() in object.factory()
Changes to object.factory():
* The second argument will be automatically interpreted as public function name, file name or program code
* The program starts earlier (when the robot is ready, not when the doors open)
* Refactored to std::string
2015-07-22 16:16:16 +02:00
krzys-h 329393a65a Added object.velocity, closes #523 2015-07-22 13:46:13 +02:00
krzys-h abdb4e9782 Moved "object" class management to CScriptFunctions 2015-07-22 13:25:51 +02:00
krzys-h 347654db15 Refactored CBot class "file" to PHYSFS 2015-07-19 22:34:41 +02:00
krzys-h 0554a77813 Refactor reading "object" class in CBot 2015-07-19 21:53:08 +02:00
krzys-h 264f5dc278 Removed obsolete save directory configuration
This was used in one of the CeeBots probably for setting up networked installations in schools. This is now obsolete since now those are only paths relative to main PHYSFS save directory.
2015-07-19 16:05:09 +02:00
krzys-h c8f6e8124e Replaced CLogger::GetInstancePointer() calls with GetLogger() 2015-07-16 22:12:44 +02:00
Piotr Dziwinski 31bc740f4b Fix focusing issues with controls and cheat console 2015-07-15 19:11:48 +02:00
Piotr Dziwinski d5da68d59a Refactor old Get/SetAngle/Zoom -> Get/SetPartRotation/Scale 2015-07-14 21:35:43 +02:00
krzys-h 4506a4b8bd TraceColor enum 2015-07-14 13:53:50 +02:00
krzys-h 78f4749134 Disallow controlling enemy objects from CBot 2015-07-13 18:53:56 +02:00
krzys-h 0e66104829 Hacked CBot engine to get pointers to CObject* in calls to class members 2015-07-13 18:40:13 +02:00
krzys-h 79c131394d Separate DoneResearch for teams 2015-07-13 18:13:28 +02:00
krzys-h 3479c51bb9 Refactored EnableBuild, EnableResearch and DoneResearch
* Moved from global variables to CRobotMain members
* Added functions for accessing the values
* Cleaned up some code related to building objects, BotFactory, ResearchCenter and AutoLab
2015-07-13 17:38:19 +02:00
Piotr Dziwinski e72936c240 Clean up more functions from COldObjectInterface 2015-07-12 20:05:12 +02:00
Piotr Dziwinski 394f911d7b Remove unnecessary #include "object/object.h" 2015-07-12 14:23:18 +02:00
Piotr Dziwinski 3ed8980c46 Make CTask classes use COldObject 2015-07-12 14:22:12 +02:00
Piotr Dziwinski 9a7c1961a4 GetPostion(), GetRotation() and GetScale() in CObject interface
Also replace old calls like GetPosition(0) to GetPosition()
2015-07-12 11:05:50 +02:00
krzys-h 639de56e6c Fixed file.readln() help file 2015-07-11 18:36:36 +02:00
krzys-h 9537048964 Cleaned up GetHelpFilename 2015-07-10 23:30:11 +02:00
Piotr Dziwinski 5d30de0d09 CProgrammableObject interface 2015-07-10 20:46:33 +02:00
krzys-h 26619e3f88 Removed old level parser functions (cmdtoken.cpp) 2015-07-10 11:51:59 +02:00
krzys-h e6c6b77be2 Removed old Teen objects
The models for them were removed a looong time ago, but the code was left for no reason
2015-07-10 11:37:32 +02:00
Piotr Dziwinski 9b232ee3f5 Sound enum refactoring
* rename Sound -> SoundType
 * add parsing string to SoundType
2015-07-09 21:32:25 +02:00
krzys-h 5da4adad41 Added Any constant in CBot 2015-07-07 19:01:18 +02:00
krzys-h 79c5fabfe6 Support for team filters in radar() 2015-07-07 18:54:36 +02:00
krzys-h 9a873c9bea Added object.team in CBot 2015-07-07 18:11:28 +02:00
krzys-h a32efc09a2 Refactored EndMissionTake and AudioChange 2015-07-07 16:17:19 +02:00
dreamer.dead 958ef43c1e Address review remarks, fix names and errors in code. 2015-07-06 22:00:33 +03:00
dreamer.dead b3c2d2c450 Set CBotVar::m_binit type to specific enum instead of plain int. 2015-07-05 23:39:55 +03:00
Piotr Dziwinski b00d62b9bb Further cleaning of CObject interface
* remove unused functions/members
 * delegate some functions to other objects
 * change some names to be more meaningful
2015-06-29 22:46:13 +02:00
Piotr Dziwinski f871ba4729 Create CExchangePost subclass 2015-06-27 23:22:55 +02:00
krzys-h 4fc8364136 Fixed Destroyer object destruction (fixes #308) 2015-06-26 19:20:16 +02:00
Piotr Dziwinski 67be6fca2a CObject interface cleanup
* remove unused functions and members
 * make protected functions used only locally or in factory
 * rename some functions to be more meaningful
 * refactor some enums to enum classes
2015-06-25 20:43:50 +02:00
Piotr Dziwinski 7814c0c7bd Remove unused field "material" from CObject class in CBot 2015-06-25 18:07:48 +02:00
Piotr Dziwinski 8806d1708d Proper CAuto, CBrain, CMotion, CPhysics, CPyro lifetime management
* change manual memory manament to std::unique_ptr
 * create CPyroManager
 * finally get rid of CInstanceManager
2015-06-22 21:58:58 +02:00
Piotr Dziwinski 0c9a9bce98 Proper CObject lifetime management
CObjectManager is now the only class responsible for storing CObjects
2015-06-21 15:13:55 +02:00
Piotr Dziwinski fed67e6640 Rename objman.h/cpp -> object_manger.h/cpp 2015-06-20 20:02:40 +02:00
Piotr Dziwinski f9b09d08f0 Create CObjectFactory
* move functions creating objects to new class CObjectFactory
 * replace calls to CObject::Create*() with CObjectManager::Create()
 * move creation/deletion of some objects to better places
 * make CModelManager non-singleton
 * clean up some code in changed functions
2015-06-20 19:37:25 +02:00
Tomasz Kapuściński f69dfe3421 shield() rejects incorrect robots that try to invoke it (should fix #475) 2015-05-28 14:03:05 +02:00
Tomasz Kapuściński 361a8c4ddd Another fix to warning 2015-05-19 17:24:07 +02:00
Tomasz Kapuściński 3a1dffd8df Fixing some warnings 2015-05-19 17:15:08 +02:00
Tomasz Kapuściński c28e1f6150 Added CBot functions for rounding: floor(), ceil(), round(), and trunc() 2015-05-06 23:29:55 +02:00
Tomasz Kapuściński 1db9d8bdca Changed CBot file handling, potentially solved problems with 64-bit executables 2015-05-06 20:39:09 +02:00
Tomasz Kapuściński 05bf5be6f4 Added atan2() function to CBot 2015-05-06 13:02:44 +02:00
Piotr Dziwinski 544e513148 Minor MSVC compilation fixes 2015-04-27 18:17:03 +02:00
krzys-h 87ccb759e6 Allow Tech to use build(), closes #461 2015-04-18 11:40:42 +02:00
krzys-h a3ae7802a2 New scripts interface, removed script limit
This is a big change in game structure and requires more testing!
2015-03-29 14:21:02 +02:00
krzys-h 47ed73247b Use std::wstring in boost::filesystem calls on Windows, fixes #414 2015-03-22 13:36:23 +01:00
krzys-h 2b21f5f40c Fixed another Travis problem (#393) 2015-03-21 17:29:17 +01:00
krzys-h f582b58c2e Fixed "files" directory creation
Related to #444
2015-03-08 16:21:09 +01:00
krzys-h f54b46b61d CPathManager
* Moved path management from CApplication to CPathManager
* Moved %lvl% replacements from CParserParam to CPathManager
* Added %lvl% support in produce(), closes #426
2015-03-08 15:22:21 +01:00
Tomasz Kapuściński 03bb000e82 Revert "Potential fix to Travis build fails"
This reverts commit ed0e5dfef5.
2015-01-31 11:55:37 +01:00
Tomasz Kapuściński ed0e5dfef5 Potential fix to Travis build fails 2015-01-30 22:13:07 +01:00
krzys-h 0ee86c3d15 Fixed loading scripts in produce() (#418) 2015-01-08 19:21:02 +01:00
krzys-h 61b186343f Fixed #424, #423 and probably #421 2015-01-08 18:56:26 +01:00
krzys-h 4fef3af9ef Moved all CObject management from CInstanceManager to CObjectManager 2014-12-21 19:04:31 +01:00
krzys-h e8a0dc8ddb CObjectManager::Radar 2014-12-20 20:36:09 +01:00
krzys-h c5b6faea05 Refactored CObjectManager to std::map 2014-12-20 19:09:53 +01:00
krzys-h 58bc01c82c Removed unused script/dd.cpp 2014-12-20 18:48:44 +01:00
krzys-h 07c651bd0a Moved all CBot functions into a separate class 2014-12-20 18:45:46 +01:00
krzys-h af9960d41e Fixed saving files from CBot 2014-12-20 18:20:59 +01:00
krzys-h ce27a80caa Moved "file" CBot class (CRobotMain -> CScript) 2014-12-20 18:03:49 +01:00
tomangelo2 7b03479a85 Fixed #386 2014-11-12 10:07:25 +01:00
krzys-h abcbaa1902 Fixed running programs with long names (#379) 2014-11-10 22:42:05 +01:00
krzys-h f65b00089a Merge branch 'dev' into dev-physfs
Conflicts:
	data
2014-10-14 15:42:19 +02:00
krzys-h 9fd6cf5449 Changed all occurences of PPC in the code to TerranovaTeam 2014-10-14 15:26:18 +02:00
krzys-h 740036e430 New level parser
Known issues:
* TerrainLevel for some reason doesn't work
* %lvl% is not yet implemented everywhere because of hardcoded directories in functions
2014-09-24 22:56:19 +02:00
krzys-h 96d49d84aa Merge branch 'dev' into dev-physfs
Conflicts:
	data
	src/app/gamedata.cpp
	src/ui/control.cpp
	src/ui/edit.cpp
	src/ui/maindialog.cpp
2014-07-11 15:24:44 +02:00
krzys-h bc3b7ef283 Fixed negative parameter in fire() (issue #305)
Also fixed checking parameter count and type for ants, spiders and shooters
2014-06-26 21:06:53 +02:00
Krzysztof Dermont 3aca1de731 More work on levels 2014-06-22 21:30:23 +02:00
Krzysztof Dermont 2260f6bf4f Big part of PhysFS support
* removed -mod argument
* removed -datadir argument
* removed -lang argument
* removed some dead ui code
* added resource manager and file loaders (stream and SDL)
* changed interface textures location to match new directory structure
* removed CGameData for mod support
* added PhysFS support
2014-06-20 23:51:28 +02:00
krzys-h f0d97bfdb9 Better datadir mod support 2014-05-18 12:12:47 +02:00
Oleg Kosmakov a2a4eb75cb Whitespace 2014-03-21 13:22:02 +02:00
Oleg Kosmakov 119fce546a Issue #295 - continue
Renamed the method, fixed typo in comments
2014-03-21 13:18:28 +02:00
Oleg Kosmakov 7485ed790c Fixes #295
When cannon cannot turn at specified angle, it will still reach the edge angle, but return the error code
2014-03-21 13:08:36 +02:00
krzys-h fbe2bf8bc7 Added special mode in scene for bots to build more buildings than they usualy can
Will be used in "Leaving Earth" missions for making decorative bots building base
2014-03-03 21:55:28 +01:00
Piotr Dziwinski 181a404930 Fixed warnings about unknown commands in scene files 2014-01-18 19:24:08 +01:00
krzys-h 652dc6081d Removed some unused objects 2014-01-11 23:43:10 +01:00
krzys-h d855586674 Fixed a bug from 59935b4706
Cmd() now checks if length of token we're looking for is equal to token we've found
2014-01-11 18:22:37 +01:00
krzys-h 59935b4706 Changed comments in ObjectType to be object categories; removed unused SEAWEED 2014-01-01 17:33:19 +01:00
krzys-h 90437d1765 Fixed two bugs in dc81cda4b1
* win/end scene animations
* produce() was producing empty cells
2014-01-01 16:45:08 +01:00
krzys-h 3d7017525b Added camerafocus() for changing camera 2013-12-31 19:09:54 +01:00
krzys-h 4a237f5925 CPauseManager 2013-12-31 13:24:09 +01:00
krzys-h 12e17224b3 Added nullptr shecks to object.factory()
Trying to fix #275
2013-12-29 16:31:32 +01:00
krzys-h a36450a6da Added tool= i drive= 2013-12-29 15:03:21 +01:00
krzys-h dc81cda4b1 Cleaned up creating objects 2013-12-29 12:08:59 +01:00
krzys-h 0d31f59b12 .takeoff() for SpaceShip (#265) 2013-12-26 18:50:05 +01:00
krzys-h f1e267b18e Fixed bug #240 - CAuto in produce() 2013-12-25 19:13:15 +01:00
Piotr Dziwinski 8deb130572 Changed char[] to std::string in restext
Experimental changes
2013-12-04 00:15:39 +01:00
Piotr Dziwinski 5d0d9b5aa5 Fixed some CBot-related memory leaks
* fixed leaks in CScript::CheckToken()
 * fixed leaks in CInterface
 * commented out unused function in robotmain.cpp
2013-10-12 18:50:30 +02:00
erihel 41fa8458c2 Some Ui refactoring 2013-06-24 22:09:39 +02:00
Piotr Dziwinski 8765d58b02 Fixed code formatting
* moved braces to new lines
 * fixed some function/variable names
 * fixed whitespace issues
2013-05-27 10:19:16 +02:00
Piotr Dziwinski 538745a731 Fixed some compilation warnings
* fixed warnings about hiding virtual functions and several others
2013-05-27 10:19:04 +02:00
krzys-h f90a4b48f5 Added object.research(type) 2013-05-19 21:48:29 +02:00
krzys-h 6798641a71 Translated <erreur> and <sans nom> 2013-05-19 17:03:55 +02:00
krzys-h 6b25608e69 Added progfunc( funcname );
For simple creating of programs executing public functions :)

Example:

    public void object::SecondBot()
    {
        message("It works!");
    }
    extern void object::FirstBot()
    {
        object item = radar(BotFactory);
        item.factory(WheeledGrabber, progfunc("SecondBot"));
    }
2013-05-19 16:56:08 +02:00
krzys-h b9d0ee034e Running program in robots created using object.factory() 2013-05-19 16:27:33 +02:00