Skip to content

Commit

Permalink
Merge pull request #197 from WhiteCloud0123/develop
Browse files Browse the repository at this point in the history
将“point sm_to_ms_copy(const point& p)”和“tripoint sm_to_ms_copy(const tripoint& p)”内联。
  • Loading branch information
WhiteCloud0123 authored Jul 14, 2023
2 parents f62cd30 + 7b3dae7 commit 41b9651
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
8 changes: 0 additions & 8 deletions src/coordinate_conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,7 @@ point ms_to_sm_remain( int &x, int &y )
return point( divide( x, SEEX, x ), divide( y, SEEY, y ) );
}

point sm_to_ms_copy( const point &p )
{
return point( p.x * SEEX, p.y * SEEY );
}

tripoint sm_to_ms_copy( const tripoint &p )
{
return tripoint( p.x * SEEX, p.y * SEEY, p.z );
}

void sm_to_ms( int &x, int &y )
{
Expand Down
14 changes: 12 additions & 2 deletions src/coordinate_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#ifndef CATA_SRC_COORDINATE_CONVERSIONS_H
#define CATA_SRC_COORDINATE_CONVERSIONS_H

#include "game_constants.h"
#include "point.h"

/**
Expand Down Expand Up @@ -136,8 +137,17 @@ inline tripoint ms_to_sm_remain( tripoint &p )
// submap back to map squares, basically: x *= SEEX
// Note: this gives you the map square coordinates of the top-left corner
// of the given submap.
point sm_to_ms_copy( const point &p );
tripoint sm_to_ms_copy( const tripoint &p );

inline point sm_to_ms_copy(const point& p)
{
return point(p.x * SEEX, p.y * SEEY);
}

inline tripoint sm_to_ms_copy(const tripoint& p)
{
return tripoint(p.x * SEEX, p.y * SEEY, p.z);
}

void sm_to_ms( int &x, int &y );
inline void sm_to_ms( point &p )
{
Expand Down
2 changes: 1 addition & 1 deletion 内容汇总.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

7 错误修复部分:(1)骑乘状态的宠物不再对幻觉产生反应。(2) 修复了进入深坑中的机甲,弹出时手中的机甲武器没有正常移除的问题。(3)修复了安装在宠物上的包没有正确处理包中事先存在的物品的问题。(4)修复获得成就时的崩溃。(5)修复一个由于过期指针而导致的崩溃。(6)修复怪物攻击死亡NPC时的崩溃。(7)修复“移动家居综合体便利店内的旗杆”。(8)修复安卓手机上的游戏画面出现各种线条的问题。因为修复方案的问题,加载贴图包和切换贴图包耗费的时间相比之前要长。

8 优化部分:(1)优化了身边有大量物品时的制作速度。(2)缓存角色的辐射水平。(3)将"limb_scores"存储为map,而不是vector。(4)将“count_*_flag”替换为“has_*_flag”。(5)在vehicle.cpp里,优化以及移除多余的代码。(6)重写 Effect type modifiers。
8 优化部分:(1)优化了身边有大量物品时的制作速度。(2)缓存角色的辐射水平。(3)将"limb_scores"存储为map,而不是vector。(4)将“count_*_flag”替换为“has_*_flag”。(5)在vehicle.cpp里,优化以及移除多余的代码。(6)重写 Effect type modifiers。(7)将“point sm_to_ms_copy(const point& p)”和“tripoint sm_to_ms_copy(const tripoint& p)”内联。

9 在宠物菜单添加"从xxx背包中取出物品"的选项。

Expand Down
4 changes: 3 additions & 1 deletion 参考、学习以及引用的内容一览.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ https://github.com/andrei8l/Cataclysm-DDA/commit/e5b43223b156c06b160d1184407810f

[Optimization and redundant code removal in vehicle.cpp](https://github.com/CleverRaven/Cataclysm-DDA/pull/64059) GitHub作者:[cake-pie](https://github.com/cake-pie)

[Effect type modifiers rewrite](https://github.com/CleverRaven/Cataclysm-DDA/pull/63056) GitHub作者:[Farseer2](https://github.com/Farseer2)
[Effect type modifiers rewrite](https://github.com/CleverRaven/Cataclysm-DDA/pull/63056) GitHub作者:[Farseer2](https://github.com/Farseer2)

[Inline sm_to_ms_copy for multi% cpu wins in congested places.](https://github.com/CleverRaven/Cataclysm-DDA/pull/66889) GitHub作者:[akrieger](https://github.com/akrieger)

0 comments on commit 41b9651

Please sign in to comment.