View Issue Details

IDProjectCategoryView StatusLast Update
0007057Multi Theft Auto : San AndreasServerpublic2013-04-21 14:10
ReporterKenixAssigned ToJusonex 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version 
Target Version1.4Fixed in Version1.4 
Summary0007057: Request bitwise operations
Description

In lua 5.2 included bitwise operations. Can be this included to mta?
http://www.lua.org/manual/5.2/manual.html#pdf-bit32

TagsNo tags attached.

Activities

x86

2012-05-05 12:38

administrator   ~~0016599

Why ?

Kenix

2012-05-05 13:25

updater   ~~0016600

For example: hashing

asturel

2012-05-05 13:39

reporter   ~~0016601

or bit flags ^^

AHTOXA_C

2012-05-05 19:49

viewer   ~~0016602

Last edited: 2012-05-06 09:00

Yes I agree!

PhatLooser

2012-05-05 22:34

reporter   ~~0016603

Best example: Setting weapon flags.

Kernell

2012-05-10 09:47

reporter   ~~0016625

Last edited: 2012-05-10 09:49

MTA can not upgrade Lua to 5.2 version. Otherwise it would not be working.
You can implement it yourself by scripting!

Remi-X

2012-05-10 18:24

reporter   ~~0016629

I don't have much experience with this, but afaik MTA doesn't have to 'upgrade' for such things. These are functions, and can be implemented any time theoretically. It's just the question whether these Lua5.2 functions have dependencies on other 5.2 code. If not, it could directly be taken out, maybe modified here and there. Otherwise it would be possible to make some new ones instead. Just a matter of who's going to do it if it's even being done.

Besides, ofcourse it can be scripted. Almost everything can be scripted. The thing is, native functions are MUCH faster to have than scripted ones in this case. The CPU can take bitwise operations directly, whereas regular scripting won't be able to do so.

Kernell

2012-05-11 01:05

reporter   ~~0016630

Remi-X,
native MTA functions slower than Lua functions.

TheGTA

2012-05-11 01:13

updater   ~~0016631

Kernell, you are doing it wrong. Native code is always faster than .lua because it escapes the Virtual Machine.

I support the idea of custom MTA libraries, like matrix conversions (euler anyone?) to provide a stable toolchain to developers. Let all this suffering finally end D:

Kernell

2012-05-11 05:18

reporter   ~~0016632

TheGTA,
Lua is a Virtual Machine, the function call between C++ and Lua will take some time. If the library was built in Lua, then it would be faster. But it will not be noticeable, because the difference in a few milliseconds.
Of course C++ is faster, but I'm talking about the time of the call native functions.

Kenix

2013-04-21 13:37

updater   ~~0018375

Fixed in http://code.google.com/p/mtasa-blue/source/detail?r=5285#

Issue History

Date Modified Username Field Change