Skip to content
This repository was archived by the owner on Dec 27, 2020. It is now read-only.

Commit 9dca2bd

Browse files
committed
ALL: update tools
1 parent d5b0806 commit 9dca2bd

File tree

8 files changed

+1830
-588
lines changed

8 files changed

+1830
-588
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33
*.o
44
*.exe
55

6+
animb2txt
7+
bmtoppm
8+
cosb2cos
9+
delua
10+
imc2wav
11+
int2flt
12+
labcopy
13+
meshb2obj
14+
mklab
15+
set2fig
16+
setb2set
17+
sklb2txt
18+
til2bmp
19+
unlab
20+
vima
21+
luac
22+
patchex
23+
624
.deps
725
/config.h
826
/config.log

AUTHORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,6 @@ Special thanks to
7777
Bret Mogilefsky, for managing to create a SPUTM-style 3D LUA engine, and
7878
avoiding the horrible hack it could have been.
7979

80+
Benjamin Haisch, for emimeshviewer, which our EMI code borrows heavily
81+
from.
82+

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ srcdir ?= .
77

88
DEFINES := -DHAVE_CONFIG_H
99
LDFLAGS :=
10-
INCLUDES := -I. -I$(srcdir)
10+
INCLUDES := -I. -I$(srcdir) -I$(srcdir)/engines
1111
LIBS :=
1212
OBJS :=
1313
DEPDIR := .deps

base/internal_version.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#ifndef INCLUDED_FROM_BASE_VERSION_CPP
2+
#error This file may only be included by base/version.cpp
3+
#endif
4+
5+
// Reads revision number from file
6+
// (this is used when building with Visual Studio)
7+
#ifdef SCUMMVM_INTERNAL_REVISION
8+
#include "internal_revision.h"
9+
#endif
10+
11+
#ifdef RELEASE_BUILD
12+
#undef SCUMMVM_REVISION
13+
#endif
14+
15+
#ifndef SCUMMVM_REVISION
16+
#define SCUMMVM_REVISION
17+
#endif
18+
19+
#define SCUMMVM_VERSION "git" SCUMMVM_REVISION

common/endian.h

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -146,51 +146,57 @@
146146
*/
147147
#define MKTAG(a0,a1,a2,a3) ((uint32)((a3) | ((a2) << 8) | ((a1) << 16) | ((a0) << 24)))
148148

149-
// Functions for reading/writing native Integers,
150-
// this transparently handles the need for alignment
151-
152-
#if !defined(SCUMM_NEED_ALIGNMENT)
149+
// Functions for reading/writing native integers.
150+
// They also transparently handle the need for alignment.
151+
152+
// Test for GCC >= 4.0. These implementations will automatically use
153+
// CPU-specific instructions for unaligned data when they are available (eg.
154+
// MIPS). See also this email thread on scummvm-devel for details:
155+
// <http://thread.gmane.org/gmane.games.devel.scummvm/8063>
156+
//
157+
// Moreover, we activate this code for GCC >= 3.3 but *only* if unaligned access
158+
// is allowed.
159+
#if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3 && !defined(SCUMM_NEED_ALIGNMENT)))
153160

154161
FORCEINLINE uint16 READ_UINT16(const void *ptr) {
155-
return *(const uint16 *)(ptr);
162+
struct Unaligned16 { uint16 val; } __attribute__ ((__packed__, __may_alias__));
163+
return ((const Unaligned16 *)ptr)->val;
156164
}
157165

158166
FORCEINLINE uint32 READ_UINT32(const void *ptr) {
159-
return *(const uint32 *)(ptr);
167+
struct Unaligned32 { uint32 val; } __attribute__ ((__packed__, __may_alias__));
168+
return ((const Unaligned32 *)ptr)->val;
160169
}
161170

162171
FORCEINLINE void WRITE_UINT16(void *ptr, uint16 value) {
163-
*(uint16 *)(ptr) = value;
172+
struct Unaligned16 { uint16 val; } __attribute__ ((__packed__, __may_alias__));
173+
((Unaligned16 *)ptr)->val = value;
164174
}
165175

166176
FORCEINLINE void WRITE_UINT32(void *ptr, uint32 value) {
167-
*(uint32 *)(ptr) = value;
177+
struct Unaligned32 { uint32 val; } __attribute__ ((__packed__, __may_alias__));
178+
((Unaligned32 *)ptr)->val = value;
168179
}
169180

170-
// test for GCC >= 4.0. these implementations will automatically use CPU-specific
171-
// instructions for unaligned data when they are available (eg. MIPS)
172-
#elif defined(__GNUC__) && (__GNUC__ >= 4)
181+
#elif !defined(SCUMM_NEED_ALIGNMENT)
173182

174183
FORCEINLINE uint16 READ_UINT16(const void *ptr) {
175-
struct Unaligned16 { uint16 val; } __attribute__ ((__packed__, __may_alias__));
176-
return ((const Unaligned16 *)ptr)->val;
184+
return *(const uint16 *)(ptr);
177185
}
178186

179187
FORCEINLINE uint32 READ_UINT32(const void *ptr) {
180-
struct Unaligned32 { uint32 val; } __attribute__ ((__packed__, __may_alias__));
181-
return ((const Unaligned32 *)ptr)->val;
188+
return *(const uint32 *)(ptr);
182189
}
183190

184191
FORCEINLINE void WRITE_UINT16(void *ptr, uint16 value) {
185-
struct Unaligned16 { uint16 val; } __attribute__ ((__packed__, __may_alias__));
186-
((Unaligned16 *)ptr)->val = value;
192+
*(uint16 *)(ptr) = value;
187193
}
188194

189195
FORCEINLINE void WRITE_UINT32(void *ptr, uint32 value) {
190-
struct Unaligned32 { uint32 val; } __attribute__ ((__packed__, __may_alias__));
191-
((Unaligned32 *)ptr)->val = value;
196+
*(uint32 *)(ptr) = value;
192197
}
193198

199+
194200
// use software fallback by loading each byte explicitely
195201
#else
196202

@@ -390,6 +396,7 @@ inline uint32 READ_BE_UINT24(const void *ptr) {
390396
return (b[0] << 16) | (b[1] << 8) | (b[2]);
391397
}
392398

399+
// ResidualVM specific:
393400
#if defined(SCUMM_BIG_ENDIAN)
394401

395402
inline float get_float(const char *data) {

0 commit comments

Comments
 (0)