Comments (1)
- please use code markup
- the
std::make_pair(ACT_WEAPON9, "ACT_WEAPON9"),
etc. can be replaced with a temporary macro like#define ENUM_MEMBER(name) std::make_pair(name, #name)
- you can't construct an
std::string
from anullptr
- using an array means you rely upon
ACTIONS
being contiguous and starting from0
- you also need to ensure that the ordering of the members matches exactly the enum members
- ... unless you meant to write a loop in
Controls_ActionToStr
; in this case,ACT_LASTINDEX
should be the default if you don't find a matching entry in the array - or use a plain
std::map<ACTION, std::string>
which you actually want to do here, but performance of small maps (less than ~100 elements) is far inferior to linear scans std::strncpy
does not guarantee that it will create aNUL
-terminated string if the source (excluding the terminator) has the same length or is larger than the destination, so you'd need toassert
that the source length is less than128
from opentomb.
Related Issues (20)
- [Weapons] First animation is not used ?!
- Inventory ring size not based window size
- [Camera] no angle_y defined for underwater.
- Question about autoexec.lua CVARs
- Development questions HOT 11
- Cannot play TR5 movies. HOT 1
- Is the developer of this still here? HOT 46
- Bug report [missing audio] HOT 2
- Ragdolls?
- Game white screens then closes HOT 3
- Linux support? HOT 2
- Help compiling for linux HOT 3
- Is project dead? No updates in 2 Years? HOT 9
- Error compiling on Linux HOT 1
- Package replacement? HOT 16
- Overwriting game saves is buggy
- Stepping left and right bugs.
- One occasion where a bat did not stop animating and making a noise after death
- Certain bits of terrain, after attempting to jump up onto a platform, it's possible to fall through it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentomb.