mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:37:34 +00:00
Ports: Update openttd's patches to use git patches
This commit is contained in:
parent
2c71a62e09
commit
32c380b7f9
11 changed files with 201 additions and 78 deletions
36
Ports/openttd/patches/0002-Memory.patch
Normal file
36
Ports/openttd/patches/0002-Memory.patch
Normal file
|
@ -0,0 +1,36 @@
|
|||
From 1e9569da4e5b1855031495ca2455ed6fa186b3df Mon Sep 17 00:00:00 2001
|
||||
From: Gunnar Beutner <gbeutner@serenityos.org>
|
||||
Date: Sat, 17 Apr 2021 15:40:17 +0200
|
||||
Subject: [PATCH 2/6] Memory
|
||||
|
||||
FIXME: There is no information available about this patch, fill this in.
|
||||
---
|
||||
src/spritecache.cpp | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
|
||||
index 6d5ce01..2fda8df 100644
|
||||
--- a/src/spritecache.cpp
|
||||
+++ b/src/spritecache.cpp
|
||||
@@ -944,6 +944,7 @@ static void GfxInitSpriteCache()
|
||||
/* Remember 'target_size' from the previous allocation attempt, so we do not try to reach the target_size multiple times in case of failure. */
|
||||
static uint last_alloc_attempt = 0;
|
||||
|
||||
+#ifndef __serenity__
|
||||
if (_spritecache_ptr == nullptr || (_allocated_sprite_cache_size != target_size && target_size != last_alloc_attempt)) {
|
||||
delete[] reinterpret_cast<byte *>(_spritecache_ptr);
|
||||
|
||||
@@ -979,6 +980,10 @@ static void GfxInitSpriteCache()
|
||||
ScheduleErrorMessage(msg);
|
||||
}
|
||||
}
|
||||
+#else
|
||||
+ _allocated_sprite_cache_size = target_size / 5;
|
||||
+ _spritecache_ptr = reinterpret_cast<MemBlock *>(new byte[_allocated_sprite_cache_size]);
|
||||
+#endif
|
||||
|
||||
/* A big free block */
|
||||
_spritecache_ptr->size = (_allocated_sprite_cache_size - sizeof(MemBlock)) | S_FREE_MASK;
|
||||
--
|
||||
2.36.1
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue