1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/lib
K 3a27725fcb Optimize CMap::isInTheMap
replace x >= 0 && x < size by (unsigned)x < size

By converting signed coordinate to unsigned number, negative values became
very large positive ones, larger than every positive signed number and
therefore also bigger than the map size. As a result check against size
also implicitly checks if coordinate is negative.

Compiler cannot do this transformation automatically because it doesn't
know that map dimensions are always positive.

The change shrinks isInTheMap from 19 instructions to 11 on x86.
2024-08-22 11:39:24 +02:00
..
battle Merge pull request #4437 from IvanSavenko/battle_sides 2024-08-14 18:37:05 +03:00
bonuses Workaround on crash on visiting configurable building with "bonus" 2024-08-14 17:03:25 +00:00
campaign Merge pull request #4443 from IvanSavenko/fix_sonar 2024-08-14 17:12:27 +03:00
constants Deprecate previously hardcoded buildings 2024-08-19 11:47:13 +00:00
entities Restored replacement of town building bonuses via building upgrade 2024-08-19 11:47:13 +00:00
events Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
filesystem Add .ogv (HD Edition) as recognized extension for video 2024-08-20 19:23:55 +00:00
gameState code review 2024-08-14 22:36:54 +02:00
json Split CGeneralTextHandler file into 1 file per class form 2024-07-20 12:55:17 +00:00
logging Fix miscellaneous issues discovered by Sonar 2024-08-12 18:26:30 +00:00
mapObjectConstructors Added (mostly) complete schema for validation of rewardable 2024-08-14 17:04:44 +00:00
mapObjects Restored replacement of town building bonuses via building upgrade 2024-08-19 11:47:13 +00:00
mapping Optimize CMap::isInTheMap 2024-08-22 11:39:24 +02:00
minizip Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
modding Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
network Fix miscellaneous issues discovered by Sonar 2024-08-12 18:26:30 +00:00
networkPacks Merge branch 'develop' into extended_statistic 2024-08-20 20:25:16 +02:00
pathfinder NKAI: whirlpool 2024-07-21 17:20:54 +03:00
registerTypes Rename town building types to more clear names 2024-08-19 11:47:13 +00:00
rewardable support 0 spellpower and knowledge 2024-08-06 01:26:39 +08:00
rmg Cleanup 2024-07-30 08:50:33 +02:00
serializer Merge branch 'develop' into extended_statistic 2024-08-20 20:25:16 +02:00
spells allow lowercase 'X' in spellRangeInHexes 2024-08-18 18:46:54 +02:00
texts Fix miscellaneous issues discovered by Sonar 2024-08-12 18:26:30 +00:00
vstd
AI_Base.h
ArtifactUtils.cpp ArtifactsUIController class 2024-07-09 14:27:05 +03:00
ArtifactUtils.h ArtifactsUIController class 2024-07-09 14:27:05 +03:00
BasicTypes.cpp not use separate function 2024-08-10 21:48:16 +08:00
BattleFieldHandler.cpp introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
BattleFieldHandler.h introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
CAndroidVMHelper.cpp
CAndroidVMHelper.h
CArtHandler.cpp Fix miscellaneous issues discovered by Sonar 2024-08-12 18:26:30 +00:00
CArtHandler.h Fix miscellaneous issues discovered by Sonar 2024-08-12 18:26:30 +00:00
CArtifactInstance.cpp
CArtifactInstance.h
CBonusTypeHandler.cpp Split CGeneralTextHandler file into 1 file per class form 2024-07-20 12:55:17 +00:00
CBonusTypeHandler.h
CConfigHandler.cpp
CConfigHandler.h
CConsoleHandler.cpp Do not try to shoot at 2nd hex of wide creatures 2024-08-14 10:38:59 +00:00
CConsoleHandler.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CCreatureHandler.cpp Merge pull request #4402 from Laserlicht/8th_creature 2024-08-14 17:04:32 +03:00
CCreatureHandler.h introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
CCreatureSet.cpp Split CGeneralTextHandler file into 1 file per class form 2024-07-20 12:55:17 +00:00
CCreatureSet.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CGameInfoCallback.cpp Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
CGameInfoCallback.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CGameInterface.cpp Unified handling of battle sides ID's 2024-08-11 20:54:44 +00:00
CGameInterface.h Unified handling of battle sides ID's 2024-08-11 20:54:44 +00:00
CHeroHandler.cpp Merge pull request #4415 from godric3/map-editor-validate-spells 2024-08-12 17:20:01 +03:00
CHeroHandler.h introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
CMakeLists.txt Merge pull request #4318 from IvanSavenko/upscaled_render 2024-08-20 14:23:30 +03:00
Color.h icon drawing 2024-08-15 00:21:02 +02:00
ConstTransitivePtr.h
CPlayerState.cpp introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
CPlayerState.h introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
CRandomGenerator.cpp Integrating changes from PR #4251 - add logging for rng 2024-07-16 15:31:58 +00:00
CRandomGenerator.h Replaced most of usages of CRandomGenerator with vstd::RNG in library 2024-07-16 13:13:07 +00:00
CScriptingModule.cpp
CScriptingModule.h
CSkillHandler.cpp introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
CSkillHandler.h introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
CSoundBase.h Fix issues introduced by fixing typos 2024-06-27 08:38:04 +00:00
CStack.cpp Unified handling of battle sides ID's 2024-08-11 20:54:44 +00:00
CStack.h Unified handling of battle sides ID's 2024-08-11 20:54:44 +00:00
CStopWatch.h
CThreadHelper.cpp Added changing thread name for FreeBSD 2024-05-12 15:10:29 +00:00
CThreadHelper.h
ExceptionsCommon.h Show error message on load if mod has broken creature instead of 2024-06-01 11:49:51 +00:00
ExtraOptionsInfo.cpp
ExtraOptionsInfo.h
FunctionList.h
GameCallbackHolder.h
GameConstants.h
GameSettings.cpp use primary skill array 2024-08-08 22:03:54 +08:00
GameSettings.h use primary skill array 2024-08-08 22:03:54 +08:00
IBonusTypeHandler.h
IGameCallback.cpp Rename town building types to more clear names 2024-08-19 11:47:13 +00:00
IGameCallback.h Moved banks randomization to server-side with client netpack 2024-07-16 13:13:39 +00:00
IGameEventsReceiver.h Unified handling of battle sides ID's 2024-08-11 20:54:44 +00:00
IHandlerBase.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
IHandlerBase.h lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
int3.h
LoadProgress.cpp
LoadProgress.h
LogicalExpression.cpp Split CGeneralTextHandler file into 1 file per class form 2024-07-20 12:55:17 +00:00
LogicalExpression.h
ObstacleHandler.cpp introduce modScope into ObstacleInfo 2024-08-12 13:57:27 +02:00
ObstacleHandler.h introduce modScope into ObstacleInfo 2024-08-12 13:57:27 +02:00
Point.h
Rect.cpp
Rect.h First iteration of upscaled rendering 2024-08-17 15:25:25 +00:00
ResourceSet.cpp
ResourceSet.h
RiverHandler.cpp introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
RiverHandler.h introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
RoadHandler.cpp introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
RoadHandler.h introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
ScopeGuard.h
ScriptHandler.cpp
ScriptHandler.h
StartInfo.cpp code review 2024-07-29 22:54:42 +02:00
StartInfo.h fix uninitialized var 2024-07-29 23:05:55 +02:00
StdInc.cpp
StdInc.h
TerrainHandler.cpp introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
TerrainHandler.h introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
TurnTimerInfo.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
TurnTimerInfo.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
UnlockGuard.h
vcmi_endian.h
VCMI_Lib.cpp Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
VCMI_Lib.h Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
VCMIDirs.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
VCMIDirs.h