Anders Jenbo
f761c73723
Correct CelBlitWidth signature
6 years ago
Marek Majkowski
d6f268545c
Misc: Don't call SwapLE32 on unaliged memory
...
On some architectures it's illegal to do unaligned memory fetches. Just
don't load 4 bytes at once, instead load byte-by-byte. A smart compiler
is supposed to recognize the pattern as little-endian unaligned load.
6 years ago
Robin Eklind
f9fa98984b
engine: pass tbl parameter explicitly instead of using default parameter values
...
This helps make the header files in `Source/*.h` parsable from both
C and C++.
Any headers in SourceX can easily be C++ only, but keeping
the core Devilution code parsable as both C and C++ is
useful for integration into mods.
6 years ago
Anders Jenbo
b528d4362d
Fix rendering on Big Endian systems
6 years ago
Anders Jenbo
933262d701
Remove support for partial cel decoding
...
Since we no longer make use of this it should result in a small speed up
6 years ago
Anders Jenbo
3e7d352fde
Format files
6 years ago
Robin Eklind
e155a9423e
rename random to random_ to avoid collision with random in stdlib.h
...
Fixes #1813 .
6 years ago
Anders Jenbo
3fe2d08940
Deduplicate monster drawing
7 years ago
Anders Jenbo
f8c16a1dcb
Only use safe blitting and set gpBufEnd to the correct relative values
...
This again allows us to only selectivly render the UI panel
This also eliminates the need for the BORDER_BOTTOM 10k memory saved!
7 years ago
Anders Jenbo
337bc9b125
Render text in screen cordinates instead of buffer offsets
7 years ago
Anders Jenbo
9e1b161bc0
Unify upper and lower screen rendering
7 years ago
Anders Jenbo
11e8df8f6c
Deduplicate missile rendering code
7 years ago
Anders Jenbo
6597688eac
Rename cell functions
7 years ago
Gleb Mazovetskiy
65344058ec
Fix UB: Misaligned access in GetCelFrameClipped
...
runtime error: load of misaligned address 0x632000363773 for type 'WORD', which requires 2 byte alignment
0x632000363773: note: pointer points here
7f 7f 7f 3e 0a 00 02 01 50 04 00 00 00 00 7f 7f 7f 7f 7f 7f 7f 7f 7f 34 bc ac ff bc 5b f9 fc dc
It was actually out-of-bounds as well so I had to add a bounds check.
7 years ago
Anders Jenbo
1a2f2b5f52
Implement CelGetFrameClipped from the Mac 9 port
7 years ago
Anders Jenbo
64824cab2b
Implement CelGetFrameStart
7 years ago
Anders Jenbo
ce6fc51b50
Implement CelGetFrame (CEL decoder helper)
...
This implements the first of the inlined CEL decoder helper functions
that are still visable in the Mac port code.
Functions are still bin exact
7 years ago
Anders Jenbo
2012106b90
Fix spell rendering
7 years ago
Robin Eklind
2508690d9c
engine: rename rand_increment and rand_multiplier to RndInc and RndMult
...
Rationale described in a479cc56b8
as included below:
Note, neither rand_increment nor rand_multiplier are
present in the PSX debug info. To keep the names for
these variables consistent with the naming convention
used for sglGameSeed, SeedCount, SetRndSeed and
GetRndSeed (which are part of the PSX debug info), we
rename them to RndInc and RndMult, respectively.
7 years ago
Anders Jenbo
7883043adc
Clean up files with dirty headers
7 years ago
Anders Jenbo
dc4f0572f6
Remove unused variables
7 years ago
Anders Jenbo
32a51d17ca
Align function signatures with PSX symbols
...
Using
https://github.com/diasurgical/scalpel/tree/master/psx/_dump_/3/_dump_c_src_/diabpsx/source
as a reference
7 years ago
galaxyhaxz
75a150d142
DrawLine ( #1084 )
7 years ago
galaxyhaxz
5d4918eea0
LoadWithMem
7 years ago
galaxyhaxz
3a636fdcc6
Add missing functions for MI_Dummy ( #1004 )
7 years ago
galaxyhaxz
cef65ea0b6
Implement Critical section constructor
7 years ago
galaxyhaxz
4e01e03711
Cleanup default calling conventions
7 years ago
Anders Jenbo
e7d5aac5dc
Clean up engine and scrollrt attribute naming
7 years ago
galaxyhaxz
f388472713
ENG_set_pixel + engine_draw_pixel ( #691 )
7 years ago
galaxyhaxz
0bb9f666b3
Clean remaining .CEL functions ( #657 )
7 years ago
galaxyhaxz
9e4885a955
Cleanup CL2 functions ( #656 )
7 years ago
galaxyhaxz
81f3f5daa2
Cleaning Engine CEL functions ( #652 )
...
* Cleaning Engine CEL functions
* Fix C functions
7 years ago
Xadhoom
15341fdae3
More temporary 64 bit fixes; we can walk in town
7 years ago
Xadhoom
fa90e6720a
Revert random_ to random and remove extern "C" linkage
7 years ago
Xadhoom
3dd6cf1671
First try, merge compiles, but immediate crash
7 years ago
Anders Jenbo
cfbe27f3b8
Clean up ( #568 )
...
* Clean up mana checks
* Don't expose static globals
7 years ago
Anders Jenbo
9b7da61dcf
Auto format src
7 years ago
Anders Jenbo
54247a076c
C init ( #549 )
...
* Make initializers C compatible
* Compile more files as C
dthread.cpp dx.cpp init logging.cpp fault.cpp msgcmd.cpp nthread.cpp
* Update defs.h
7 years ago
Anders Jenbo
fd2a45ff9a
Engine.cpp ( #548 )
...
* Clean up DiabloAllocPtr
* Clean up mem_free_dbg
* Clean up GetDirection
* Clean up PlayInGameMovie
* 18 directions
7 years ago
Anders Jenbo
e795b6116a
Make use of atexit() C compatible ( #537 )
7 years ago
Anders Jenbo
77849aea72
Remove unused init ( #533 )
7 years ago
Robin Eklind
8ed5573766
engine: clean up CelDecDatLightEntry and Cel2DecDatLightEntry ( #524 )
...
Now, these functions no longer use references. Instead they
use pointer to pointer. Furthermore, they've been simplified
to for loops, as essentially, the decompiled functions were
unrolled loops (as seen in the memset function).
7 years ago
Anders Jenbo
b5f69dccdc
C compatability from d-p ( #519 )
7 years ago
Anders Jenbo
b1f6d3698f
Update style to use tabs
8 years ago
aperturesecurity
42ce77ce05
Rebirth and Nuke
8 years ago
squidcc
49af056b14
Clean DrawAutomapType ( #299 )
...
cosmetic name corrections
8 years ago
galaxyhaxz
38b498ac4b
Add 'const' to data to match original binary ( #200 )
8 years ago
Dennis Duda
e8b53791d3
`DrawInv` is now binary exact.
8 years ago
Dennis Duda
16a576cd5b
Brought `GetLevelMTypes` very close to binary exact
8 years ago
galaxyhaxz
5ed2336e90
Fix types of animation data ( #176 )
8 years ago