Commit Graph

24 Commits (master)

Author SHA1 Message Date
pkeus 5abb921456 Refactorizations:
- Prefer std::unordered_map over std::map
- Sort CollArr by treetypes to avoid frequent texture rebinding

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@703 0420edf4-82e4-42fc-9478-35b55e6d67a3
2018-03-22 16:17:58 +00:00
cazfi b584b18a62 Fix comparison between pointer and an integer
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@701 0420edf4-82e4-42fc-9478-35b55e6d67a3
2018-03-19 15:59:51 +00:00
pkeus debff52b66 Improved TTextField widget: set cursor position when clicking, more efficient calculation of cursor position
Fixed several cppcheck messages

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@693 0420edf4-82e4-42fc-9478-35b55e6d67a3
2017-03-28 16:41:50 +00:00
pkeus ca62e16ae8 Refactorization: Use proper <cmath> functions, such as std::hypot() and std::log2() where appropriate. Added missing std:: prefix to some more <cmath> functions.
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@603 0420edf4-82e4-42fc-9478-35b55e6d67a3
2016-01-19 16:52:26 +00:00
pkeus 78729153f1 Added missing std:: prefixes to several C functions. Fixed type conversion issue in ogl.cpp
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@602 0420edf4-82e4-42fc-9478-35b55e6d67a3
2016-01-19 16:16:09 +00:00
pkeus ee35f1a467 Applied patch by Mattias Ugelvik:
- Use different coloring in HUD in event mode to indicate how well the player does
- Added missing std:: prefixes for min() and max() functions

Define NOMINMAX in VS solution to get rid of the WinAPI definition of min() and max() as macros.

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@601 0420edf4-82e4-42fc-9478-35b55e6d67a3
2016-01-19 13:27:21 +00:00
pkeus 7420115fbe Fixed 128 type conversion warnings from VS.
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@600 0420edf4-82e4-42fc-9478-35b55e6d67a3
2016-01-19 13:07:10 +00:00
pkeus 85a6b4d9f9 Removed "using namespace std;"
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@598 0420edf4-82e4-42fc-9478-35b55e6d67a3
2016-01-18 16:55:59 +00:00
pkeus 62634d1b4d Fixed CppCheck and VS Code Analysis messages, replaced usage of deprecated sf::Text::setColor()
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@536 0420edf4-82e4-42fc-9478-35b55e6d67a3
2016-01-07 13:00:59 +00:00
pkeus 36dfdbf550 Refactorizations:
- Break dangerous inheriting of TVector4 from TVector3 from TVector2: Silent casts between them could cause bugs if function is not implemented for the actual type
- Implemented unary minus operator for TVector* types; Implemented DotProduct for TVector4
- Fixed some cppcheck messages
- Some stylistic fixes

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/branches/SFML2@533 0420edf4-82e4-42fc-9478-35b55e6d67a3
2014-09-20 18:18:19 +00:00
pkeus 15085ce2d6 Refactorizations:
- Visual Studio: Increased warning level to W4 (minus C4100 and C4512), enabled /Zc:inline
- Replaced NULL by nullptr
- Replaced 3 dynamically allocated arrays by a single std::vector CCourse::Fields
- Fixed a few MSVC W4 warnings

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/branches/SFML2@521 0420edf4-82e4-42fc-9478-35b55e6d67a3
2014-07-13 19:05:24 +00:00
pkeus ee1be7908c Bugfixes:
- Improved handling of missing data/configuration files: Print error message instead of crashing
- Fixed "auto" resolution: Use desktop mode for fullscreen
- Fixed GUI scaling in higher resolutions than 800*600
- Fixed Credits GUI broken in r492
- Updated some copyright dates to 2014

Refactorizations:
- Fixed some warnings
- Avoid copying TScore objects
- Small simplifications

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/branches/SFML2@518 0420edf4-82e4-42fc-9478-35b55e6d67a3
2014-07-12 19:00:57 +00:00
pkeus ad659cf18b Refactorizations:
- Reduced time spend in set_material(), reduced calls in track_marks.cpp
- Uniformized some more double/float usage
- Prefer copy_n over memcpy, fill_n over memset

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/branches/SFML2@515 0420edf4-82e4-42fc-9478-35b55e6d67a3
2014-07-10 21:25:13 +00:00
pkeus 49969b7924 Merged revision(s) 493-500 from trunk:
Include <sys/stat.h> for mkdir() declaration.

........
Include <string.h> for memcpy() declaration.

........
Fixed compile errors caused by mismatched ints and doubles.

........
Include <string.h> for memset() declaration.

........
Made templates standard compliant. Unqualified name lookup does not look
into dependent base classes.

........
Added new matrices.[cpp|h] and vectors.[cpp|h] sourcefiles to build. 

........
Avoid shadowing of the template parameters with local variables.

........
Updated lists of resource files to install.

........


git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/branches/SFML2@502 0420edf4-82e4-42fc-9478-35b55e6d67a3
2014-02-09 09:20:32 +00:00
pkeus ee38139d2a Uniformized paranthese padding with AStyle, use AStyle 2.04
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/branches/SFML2@491 0420edf4-82e4-42fc-9478-35b55e6d67a3
2014-01-18 09:55:13 +00:00
pkeus 12cb17cc1b Code and data cleanup:
- Cleaned up textures: Keept only those in /data/textures that are currently needed by the game. Resized several textures to remove empty space
- Refactored HUD, fixed bug in wind display when racing upwards the hill
- Removed apparently unnecessary environment box rendering in quadtree code, improving framerate during race

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/branches/SFML2@481 0420edf4-82e4-42fc-9478-35b55e6d67a3
2013-11-27 19:20:04 +00:00
pkeus 59429647f4 Fixed crash caused by uninitialized variable introduced in last commit
Refactorizations:
- Reduced code duplication with template
- removed unused code
- use string instead of char*

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@460 0420edf4-82e4-42fc-9478-35b55e6d67a3
2013-10-03 13:11:40 +00:00
pkeus 7afb08f242 Moved Vector* types out of etr_types.h; Implemented as object-oriented templates; Replaced several function by overloaded operators
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@457 0420edf4-82e4-42fc-9478-35b55e6d67a3
2013-09-30 18:17:59 +00:00
pkeus 1d5c6ffa8f Converted more code to using glVertexPointer instead of glVertex2f
Introduced method to call glColor with a TColor
Use Integer instead Float instead of Double where appropriate

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@453 0420edf4-82e4-42fc-9478-35b55e6d67a3
2013-09-30 10:16:40 +00:00
pkeus bf115c2378 Converted lots of code to using glVertexPointer instead of glVertex2f
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@452 0420edf4-82e4-42fc-9478-35b55e6d67a3
2013-09-29 18:32:44 +00:00
pkeus a5a0eb3989 Refactorizations:
- Replaced own MIN/MAX by std::min/max, use clamp whenever possible
- Use delete[] if necessary
- Refactorized light functionality: Moved similar code into function
- Enabled environment caching: Reload environment only if necessary
- Put TOdeData on stack

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@444 0420edf4-82e4-42fc-9478-35b55e6d67a3
2013-09-11 13:24:19 +00:00
pkeus 6f696dcb2c Refactorizations:
- Cleaned up includes: Moved as much system-independant includes out of bh.h
- Removed second implementation of TGA writing - they are doing the same
- Removed some redundant defines in bh.h
- Updated copyright date in main.cpp output

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@440 0420edf4-82e4-42fc-9478-35b55e6d67a3
2013-09-11 09:28:51 +00:00
pkeus 4c37a66b4e Fixed several cppcheck messages
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@437 0420edf4-82e4-42fc-9478-35b55e6d67a3
2013-09-03 11:14:32 +00:00
cazfi 83abd1b455 Moved sources to their own subdirectory src
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@417 0420edf4-82e4-42fc-9478-35b55e6d67a3
2013-08-26 21:02:38 +00:00