Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master-MC1.7.10' into master-MC1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
asiekierka committed Jun 4, 2023
2 parents f2908ac + a4a3b77 commit a7e869e
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 111 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* [#3620] Fixed OC 1.8.0+ regression involving API arguments and numbers.
* [#3013] Fixed rare server-side deadlock when sending disk activity update packets.
* Added Spanish translation.
* Fixed bugs in internal wcwidth() implementation and updated it to cover Unicode 12.
* Fixed server->client synchronization for some types of GPU bitblt operations.
* Fixed string.gmatch not supporting the "init" argument on Lua 5.4.
* Tweaks to server->client networking code:
* Added support for configuring the maximum packet distance for effects, sounds, and all client packets.
Expand Down
20 changes: 20 additions & 0 deletions src/main/resources/LICENSE-wcwidth
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright © 2005-2020 Rich Felker, et al.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ object GpuTextBuffer {
}

def write_to_vram(dstRam: GpuTextBuffer, x: Int, y: Int, w: Int, h: Int, src: TextBufferProxy, fx: Int, fy: Int): Boolean = {
dstRam.data.rawcopy(x + 1, y + 1, w, h, src.data, fx + 1, fy + 1)
if (dstRam.data.rawcopy(x + 1, y + 1, w, h, src.data, fx + 1, fy + 1)) {
dstRam.dirty = true
true
} else false
}
}
20 changes: 16 additions & 4 deletions src/main/scala/li/cil/oc/server/machine/ArgumentsImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,18 @@ class ArgumentsImpl(val args: Seq[AnyRef]) extends Arguments {
case value: java.lang.Number => value.intValue
*/
case value: java.lang.Double =>
if (value > java.lang.Integer.MAX_VALUE)
if (value.isNaN)
throw intError(index, value)
else if (value > java.lang.Integer.MAX_VALUE)
java.lang.Integer.MAX_VALUE
else if (value < java.lang.Integer.MIN_VALUE)
java.lang.Integer.MIN_VALUE
else
value.intValue
case value: java.lang.Float =>
if (value > java.lang.Integer.MAX_VALUE)
if (value.isNaN)
throw intError(index, value)
else if (value > java.lang.Integer.MAX_VALUE)
java.lang.Integer.MAX_VALUE
else if (value < java.lang.Integer.MIN_VALUE)
java.lang.Integer.MIN_VALUE
Expand Down Expand Up @@ -131,14 +135,18 @@ class ArgumentsImpl(val args: Seq[AnyRef]) extends Arguments {
case value: java.lang.Number => value.longValue
*/
case value: java.lang.Double =>
if (value > java.lang.Long.MAX_VALUE)
if (value.isNaN)
throw intError(index, value)
else if (value > java.lang.Long.MAX_VALUE)
java.lang.Long.MAX_VALUE
else if (value < java.lang.Long.MIN_VALUE)
java.lang.Long.MIN_VALUE
else
value.longValue
case value: java.lang.Float =>
if (value > java.lang.Long.MAX_VALUE)
if (value.isNaN)
throw intError(index, value)
else if (value > java.lang.Long.MAX_VALUE)
java.lang.Long.MAX_VALUE
else if (value < java.lang.Long.MIN_VALUE)
java.lang.Long.MIN_VALUE
Expand Down Expand Up @@ -241,6 +249,8 @@ class ArgumentsImpl(val args: Seq[AnyRef]) extends Arguments {
java.lang.Float.isFinite(value) && value >= java.lang.Integer.MIN_VALUE && value <= java.lang.Integer.MAX_VALUE
case value: java.lang.Long =>
value >= java.lang.Integer.MIN_VALUE && value <= java.lang.Integer.MAX_VALUE */
case value: java.lang.Double => !value.isNaN
case value: java.lang.Float => !value.isNaN
case value: java.lang.Number => true
case _ => false
})
Expand All @@ -252,6 +262,8 @@ class ArgumentsImpl(val args: Seq[AnyRef]) extends Arguments {
java.lang.Double.isFinite(value) && value >= java.lang.Long.MIN_VALUE && value <= java.lang.Long.MAX_VALUE
case value: java.lang.Float =>
java.lang.Float.isFinite(value) && value >= java.lang.Long.MIN_VALUE && value <= java.lang.Long.MAX_VALUE */
case value: java.lang.Double => !value.isNaN
case value: java.lang.Float => !value.isNaN
case value: java.lang.Number => true
case _ => false
})
Expand Down
Loading

0 comments on commit a7e869e

Please sign in to comment.