4726: Display super with "super" string in scoreboard (fixes #4724) r=heinrich5991 a=def-

instead of showing the number 64

Alternative to https://github.com/ddnet/ddnet/pull/4725

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


4727: Increase MAX_IDS to 32k (fixes #4723) r=heinrich5991 a=def-

Not sure I like it, otherwise we have to edit Game City.

Maybe we should fail this in map editor already instead of allowing to
create a map which requires > MAX_IDS

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


4728: Implement shields that remove specific weapon (fixes #4572) r=heinrich5991 a=def-

Thanks to Cellegen for graphics.

Functionality works, still a bit buggy sprite display (see screenshot), maybe someone can
quickly spot what I'm doing wrong

<img width="898" alt="Screenshot 2022-02-18 at 00 50 14" src="https://user-images.githubusercontent.com/2335377/154591108-d89cb475-daaf-4a6a-9748-17160a1e71a2.png">

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


4880: Add mysql to github workflow in ubuntu 20.04 r=heinrich5991 a=def-

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


5022: Use std::clamp r=heinrich5991 a=def-

Not sure if we want to, there are some easy functions like this we could
take from stdlib now

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
bors[bot] 2022-04-29 00:30:17 +00:00 committed by GitHub
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 1177 additions and 58 deletions

View file

@ -25,7 +25,7 @@ jobs:
CXXFLAGS: -Werror CXXFLAGS: -Werror
- os: ubuntu-20.04 - os: ubuntu-20.04
cmake-path: /usr/bin/ cmake-path: /usr/bin/
cmake-args: -G Ninja cmake-args: -G Ninja -DTEST_MYSQL=ON
package-file: "*-linux_x86_64.tar.xz" package-file: "*-linux_x86_64.tar.xz"
fancy: false fancy: false
env: env:
@ -60,15 +60,31 @@ jobs:
sudo apt-get upgrade -y sudo apt-get upgrade -y
sudo apt-get install pkg-config cmake ninja-build libfreetype6-dev libnotify-dev libsdl2-dev libsqlite3-dev libvulkan-dev glslang-tools spirv-tools libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev libx264-dev -y sudo apt-get install pkg-config cmake ninja-build libfreetype6-dev libnotify-dev libsdl2-dev libsqlite3-dev libvulkan-dev glslang-tools spirv-tools libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev libx264-dev -y
- name: Prepare Linux (non-fancy)
if: ${{ contains(matrix.os, 'ubuntu') && !matrix.fancy }}
run: |
sudo rm -rf /var/lib/mysql/ /var/run/mysqld
sudo mkdir /var/lib/mysql/ /var/run/mysqld/
sudo chown mysql:mysql /var/lib/mysql/ /var/run/mysqld/
sudo mysqld --initialize-insecure --user=mysql --basedir=/usr --datadir=/var/lib/mysql/
sudo /usr/bin/mysqld_safe --basedir=/usr --datadir='/var/lib/mysql/' &
sleep 10
sudo mysql <<EOF
CREATE DATABASE ddnet;
CREATE USER 'ddnet'@'localhost' IDENTIFIED BY 'thebestpassword';
GRANT ALL PRIVILEGES ON ddnet.* TO 'ddnet'@'localhost';
FLUSH PRIVILEGES;
EOF
- name: Prepare Linux (fancy) - name: Prepare Linux (fancy)
if: contains(matrix.os, 'ubuntu') && matrix.fancy if: contains(matrix.os, 'ubuntu') && matrix.fancy
run: | run: |
sudo apt-get install libmariadbclient-dev libwebsockets-dev mariadb-server-10.3 -y sudo apt-get install libmariadbclient-dev libwebsockets-dev mariadb-server-10.3 -y
sudo rm -rf /var/lib/mysql/ sudo rm -rf /var/lib/mysql/
sudo mysql_install_db --user=mysql --datadir=/var/lib/mysql/ sudo mysql_install_db --user=mysql --datadir=/var/lib/mysql/
cd /usr; sudo /usr/bin/mysqld_safe --datadir='/var/lib/mysql/' --no-watch cd /usr; sudo mysqld_safe --datadir='/var/lib/mysql/' --no-watch
sleep 10 sleep 10
sudo mariadb <<EOF sudo mysql <<EOF
CREATE DATABASE ddnet; CREATE DATABASE ddnet;
CREATE USER 'ddnet'@'localhost' IDENTIFIED BY 'thebestpassword'; CREATE USER 'ddnet'@'localhost' IDENTIFIED BY 'thebestpassword';
GRANT ALL PRIVILEGES ON ddnet.* TO 'ddnet'@'localhost'; GRANT ALL PRIVILEGES ON ddnet.* TO 'ddnet'@'localhost';
@ -141,7 +157,7 @@ jobs:
run: | run: |
mkdir fancy mkdir fancy
cd fancy cd fancy
${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDOWNLOAD_GTEST=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. -DANTIBOT=ON -DTEST_MYSQL=ON -DWEBSOCKETS=ON .. ${{ matrix.cmake-path }}cmake ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDOWNLOAD_GTEST=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. -DANTIBOT=ON -DWEBSOCKETS=ON ..
${{ matrix.cmake-path }}cmake --build . --config RelWithDebInfo --target everything ${{ matrix.build-args }} ${{ matrix.cmake-path }}cmake --build . --config RelWithDebInfo --target everything ${{ matrix.build-args }}
- name: Test fancy - name: Test fancy
if: matrix.fancy if: matrix.fancy

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 KiB

After

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 KiB

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View file

@ -1246,6 +1246,12 @@ Settings file
Config directory Config directory
== ==
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Chat command Chat command
== ==
@ -1264,6 +1270,9 @@ Windowed fullscreen
Desktop fullscreen Desktop fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1315,6 +1324,18 @@ Tee
Preview Preview
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1347,3 +1368,9 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -901,6 +901,9 @@ Max CSVs
Dummy settings Dummy settings
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
@ -913,6 +916,9 @@ Fat skins (DDFat)
Skin prefix Skin prefix
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -994,6 +1000,9 @@ may cause delay
Screen Screen
== ==
Allows maps to render with more detail
==
Use high DPI Use high DPI
== ==
@ -1147,6 +1156,9 @@ Enable replays
Default length: %d Default length: %d
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Show ghost Show ghost
== ==
@ -1162,15 +1174,24 @@ Overlay entities
Show text entities Show text entities
== ==
Opacity
==
Show others (own team only) Show others (own team only)
== ==
Show quads Show quads
== ==
Quads are used for background decoration
==
AntiPing AntiPing
== ==
Tries to predict other entities to give a feel of low latency
==
AntiPing: predict other players AntiPing: predict other players
== ==
@ -1301,6 +1322,12 @@ Update failed! Check log...
Restart Restart
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -1162,9 +1162,15 @@ Themes directory
Max CSVs Max CSVs
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -1189,6 +1195,9 @@ Windowed fullscreen
Desktop fullscreen Desktop fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1258,12 +1267,24 @@ Use old chat style
Preview Preview
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Overlay entities Overlay entities
== ==
Opacity
==
Quads are used for background decoration
==
AntiPing AntiPing
== ==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1334,6 +1355,12 @@ Editor
Play Play
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -1367,3 +1367,30 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== Não foi possível encontrar o servidor de tutorial == Não foi possível encontrar o servidor de tutorial
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Allows maps to render with more detail
==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Super
==
Team %d
==

View file

@ -898,6 +898,9 @@ Max CSVs
Dummy settings Dummy settings
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
@ -910,6 +913,9 @@ Fat skins (DDFat)
Skin prefix Skin prefix
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -994,6 +1000,9 @@ may cause delay
Screen Screen
== ==
Allows maps to render with more detail
==
Use high DPI Use high DPI
== ==
@ -1147,6 +1156,9 @@ Enable replays
Default length: %d Default length: %d
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Show ghost Show ghost
== ==
@ -1162,15 +1174,24 @@ Overlay entities
Show text entities Show text entities
== ==
Opacity
==
Show others (own team only) Show others (own team only)
== ==
Show quads Show quads
== ==
Quads are used for background decoration
==
AntiPing AntiPing
== ==
Tries to predict other entities to give a feel of low latency
==
AntiPing: predict other players AntiPing: predict other players
== ==
@ -1301,6 +1322,12 @@ Update failed! Check log...
Restart Restart
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -1344,3 +1344,30 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== No s'ha pogut trobar un servidor del tutorial == No s'ha pogut trobar un servidor del tutorial
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Allows maps to render with more detail
==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Super
==
Team %d
==

View file

@ -901,6 +901,9 @@ Max CSVs
Dummy settings Dummy settings
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
@ -913,6 +916,9 @@ Fat skins (DDFat)
Skin prefix Skin prefix
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -994,6 +1000,9 @@ may cause delay
Screen Screen
== ==
Allows maps to render with more detail
==
Use high DPI Use high DPI
== ==
@ -1147,6 +1156,9 @@ Enable replays
Default length: %d Default length: %d
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Show ghost Show ghost
== ==
@ -1162,15 +1174,24 @@ Overlay entities
Show text entities Show text entities
== ==
Opacity
==
Show others (own team only) Show others (own team only)
== ==
Show quads Show quads
== ==
Quads are used for background decoration
==
AntiPing AntiPing
== ==
Tries to predict other entities to give a feel of low latency
==
AntiPing: predict other players AntiPing: predict other players
== ==
@ -1301,6 +1322,12 @@ Update failed! Check log...
Restart Restart
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -1259,6 +1259,12 @@ Settings file
Config directory Config directory
== ==
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Chat command Chat command
== ==
@ -1277,6 +1283,9 @@ Windowed fullscreen
Desktop fullscreen Desktop fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1325,6 +1334,18 @@ Tee
Preview Preview
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1354,3 +1375,9 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -1257,6 +1257,12 @@ Settings file
Config directory Config directory
== ==
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Chat command Chat command
== ==
@ -1275,6 +1281,9 @@ Windowed fullscreen
Desktop fullscreen Desktop fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1323,6 +1332,18 @@ Tee
Preview Preview
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1352,3 +1373,9 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -1194,9 +1194,15 @@ Config directory
Themes directory Themes directory
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -1221,6 +1227,9 @@ Windowed fullscreen
Desktop fullscreen Desktop fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1287,6 +1296,18 @@ Client message
Preview Preview
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1357,6 +1378,12 @@ Editor
Play Play
== ==
Super
==
Team %d
==
Net Net
== ==

View file

@ -1244,9 +1244,15 @@ Automatically create statboard csv
Max CSVs Max CSVs
== ==
Toggle to edit your dummy settings
==
Fat skins (DDFat) Fat skins (DDFat)
== ==
Choose default eyes when joining a server
==
Dummy copy Dummy copy
== ==
@ -1265,6 +1271,9 @@ Show entities
Windowed fullscreen Windowed fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1295,15 +1304,27 @@ Kill Message Normal Color
Kill Message Highlight Color Kill Message Highlight Color
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Overlay entities Overlay entities
== ==
Show text entities Show text entities
== ==
Opacity
==
Show quads Show quads
== ==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1343,6 +1364,12 @@ Can't find a Tutorial server
Server executable not found, can't run server Server executable not found, can't run server
== ==
Super
==
Team %d
==
Auto Auto
== ==

View file

@ -1360,6 +1360,15 @@ Join Tutorial Server
Skip Tutorial Skip Tutorial
== Passer le tutoriel == Passer le tutoriel
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1375,8 +1384,26 @@ Graphics cards
auto auto
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Tutorial Tutorial
== ==
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -1366,3 +1366,30 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== Tutorial-Server kann nicht gefunden werden == Tutorial-Server kann nicht gefunden werden
Toggle to edit your dummy settings
== Umschalten um Dummy-Einstellungen zu bearbeiten
Choose default eyes when joining a server
== Standard-Augen beim Betreten eines Servers auswählen
Allows maps to render with more detail
== Erlaubt es Karten mit mehr Detail zu rendern
When you cross the start line, show a ghost tee replicating the movements of your best time
== Wenn du die Startlinie überschreitest, wird ein Geist-Tee mit den Bewegungen deiner besten Zeit gezeigt
Opacity
== Deckkraft
Quads are used for background decoration
== Quads werden als Hintergrund-Dekoration benutzt
Tries to predict other entities to give a feel of low latency
== Versucht das Verhalten andere Entitäten vorherzusagen um das Gefühl einer niederigeren Latenz zu geben
Super
== Super
Team %d
== Team %d

View file

@ -901,6 +901,9 @@ Max CSVs
Dummy settings Dummy settings
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
@ -913,6 +916,9 @@ Fat skins (DDFat)
Skin prefix Skin prefix
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -994,6 +1000,9 @@ may cause delay
Screen Screen
== ==
Allows maps to render with more detail
==
Use high DPI Use high DPI
== ==
@ -1147,6 +1156,9 @@ Enable replays
Default length: %d Default length: %d
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Show ghost Show ghost
== ==
@ -1162,15 +1174,24 @@ Overlay entities
Show text entities Show text entities
== ==
Opacity
==
Show others (own team only) Show others (own team only)
== ==
Show quads Show quads
== ==
Quads are used for background decoration
==
AntiPing AntiPing
== ==
Tries to predict other entities to give a feel of low latency
==
AntiPing: predict other players AntiPing: predict other players
== ==
@ -1301,6 +1322,12 @@ Update failed! Check log...
Restart Restart
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -1331,6 +1331,15 @@ Run on join
Chat command (e.g. showall 1) Chat command (e.g. showall 1)
== Chat parancs (például showall 1) == Chat parancs (például showall 1)
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1346,8 +1355,26 @@ Graphics cards
auto auto
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Tutorial Tutorial
== ==
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -1284,6 +1284,12 @@ Settings file
Config directory Config directory
== ==
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Converse Converse
== ==
@ -1305,6 +1311,9 @@ Windowed fullscreen
Desktop fullscreen Desktop fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1353,9 +1362,21 @@ Tee
Preview Preview
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Overlay entities Overlay entities
== ==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1386,5 +1407,11 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==
FPM FPM
== ==

View file

@ -1310,9 +1310,18 @@ Settings file
Config directory Config directory
== ==
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Windowed fullscreen Windowed fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1337,6 +1346,18 @@ Kill Message Normal Color
Kill Message Highlight Color Kill Message Highlight Color
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1351,3 +1372,9 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -1355,3 +1355,30 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== 튜토리얼 서버를 찾을 수 없음 == 튜토리얼 서버를 찾을 수 없음
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Allows maps to render with more detail
==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Super
==
Team %d
==

View file

@ -892,6 +892,9 @@ Max CSVs
Dummy settings Dummy settings
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
@ -904,6 +907,9 @@ Fat skins (DDFat)
Skin prefix Skin prefix
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -985,6 +991,9 @@ may cause delay
Screen Screen
== ==
Allows maps to render with more detail
==
Use high DPI Use high DPI
== ==
@ -1138,6 +1147,9 @@ Enable replays
Default length: %d Default length: %d
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Show ghost Show ghost
== ==
@ -1153,15 +1165,24 @@ Overlay entities
Show text entities Show text entities
== ==
Opacity
==
Show others (own team only) Show others (own team only)
== ==
Show quads Show quads
== ==
Quads are used for background decoration
==
AntiPing AntiPing
== ==
Tries to predict other entities to give a feel of low latency
==
AntiPing: predict other players AntiPing: predict other players
== ==
@ -1292,6 +1313,12 @@ Update failed! Check log...
Restart Restart
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -1258,6 +1258,12 @@ Settings file
Config directory Config directory
== ==
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Chat command Chat command
== ==
@ -1276,6 +1282,9 @@ Windowed fullscreen
Desktop fullscreen Desktop fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1324,6 +1333,18 @@ Tee
Preview Preview
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1353,3 +1374,9 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -926,9 +926,15 @@ Automatically create statboard csv
Max CSVs Max CSVs
== ==
Toggle to edit your dummy settings
==
Vanilla skins only Vanilla skins only
== ==
Choose default eyes when joining a server
==
Skins Skins
== ==
@ -983,6 +989,9 @@ may cause delay
FSAA samples FSAA samples
== ==
Allows maps to render with more detail
==
Use high DPI Use high DPI
== ==
@ -1097,6 +1106,9 @@ Save the best demo of each race
Default length: %d Default length: %d
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Show ghost Show ghost
== ==
@ -1109,12 +1121,21 @@ Overlay entities
Show text entities Show text entities
== ==
Opacity
==
Show others (own team only) Show others (own team only)
== ==
Show quads Show quads
== ==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
AntiPing: predict other players AntiPing: predict other players
== ==
@ -1202,6 +1223,12 @@ Time limit: %d min
Round Round
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -1259,6 +1259,12 @@ Settings file
Config directory Config directory
== ==
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Chat command Chat command
== ==
@ -1277,6 +1283,9 @@ Windowed fullscreen
Desktop fullscreen Desktop fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1325,6 +1334,18 @@ Tee
Preview Preview
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1354,3 +1375,9 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -1106,6 +1106,9 @@ Skip the main menu
Config directory Config directory
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
@ -1118,6 +1121,9 @@ Fat skins (DDFat)
Skin prefix Skin prefix
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -1175,6 +1181,9 @@ Windowed fullscreen
may cause delay may cause delay
== ==
Allows maps to render with more detail
==
Use high DPI Use high DPI
== ==
@ -1241,18 +1250,30 @@ Enable replays
Default length: %d Default length: %d
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Overlay entities Overlay entities
== ==
Show text entities Show text entities
== ==
Opacity
==
Show others (own team only) Show others (own team only)
== ==
Show quads Show quads
== ==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show other players' hook collision lines Show other players' hook collision lines
== ==
@ -1317,6 +1338,12 @@ Downloading %s:
Update failed! Check log... Update failed! Check log...
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -907,6 +907,9 @@ Max CSVs
Dummy settings Dummy settings
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
@ -919,6 +922,9 @@ Fat skins (DDFat)
Skin prefix Skin prefix
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -1000,6 +1006,9 @@ may cause delay
Screen Screen
== ==
Allows maps to render with more detail
==
Use high DPI Use high DPI
== ==
@ -1153,6 +1162,9 @@ Enable replays
Default length: %d Default length: %d
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Show ghost Show ghost
== ==
@ -1168,15 +1180,24 @@ Overlay entities
Show text entities Show text entities
== ==
Opacity
==
Show others (own team only) Show others (own team only)
== ==
Show quads Show quads
== ==
Quads are used for background decoration
==
AntiPing AntiPing
== ==
Tries to predict other entities to give a feel of low latency
==
AntiPing: predict other players AntiPing: predict other players
== ==
@ -1307,6 +1328,12 @@ Update failed! Check log...
Restart Restart
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -1359,3 +1359,30 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== Обучающий сервер не найден == Обучающий сервер не найден
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Allows maps to render with more detail
==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Super
==
Team %d
==

View file

@ -905,6 +905,9 @@ Max CSVs
Dummy settings Dummy settings
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
@ -917,6 +920,9 @@ Fat skins (DDFat)
Skin prefix Skin prefix
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -998,6 +1004,9 @@ may cause delay
Screen Screen
== ==
Allows maps to render with more detail
==
Use high DPI Use high DPI
== ==
@ -1151,6 +1160,9 @@ Enable replays
Default length: %d Default length: %d
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Show ghost Show ghost
== ==
@ -1166,15 +1178,24 @@ Overlay entities
Show text entities Show text entities
== ==
Opacity
==
Show others (own team only) Show others (own team only)
== ==
Show quads Show quads
== ==
Quads are used for background decoration
==
AntiPing AntiPing
== ==
Tries to predict other entities to give a feel of low latency
==
AntiPing: predict other players AntiPing: predict other players
== ==
@ -1302,6 +1323,12 @@ Update failed! Check log...
Restart Restart
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -1241,6 +1241,12 @@ Settings file
Config directory Config directory
== ==
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Chat command Chat command
== ==
@ -1259,6 +1265,9 @@ Windowed fullscreen
Desktop fullscreen Desktop fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1319,6 +1328,18 @@ Use old chat style
Preview Preview
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1351,3 +1372,9 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -1373,3 +1373,30 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== 无法找到教学服务器 == 无法找到教学服务器
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Allows maps to render with more detail
==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Super
==
Team %d
==

View file

@ -901,6 +901,9 @@ Max CSVs
Dummy settings Dummy settings
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
@ -913,6 +916,9 @@ Fat skins (DDFat)
Skin prefix Skin prefix
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -994,6 +1000,9 @@ may cause delay
Screen Screen
== ==
Allows maps to render with more detail
==
Use high DPI Use high DPI
== ==
@ -1147,6 +1156,9 @@ Enable replays
Default length: %d Default length: %d
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Show ghost Show ghost
== ==
@ -1162,15 +1174,24 @@ Overlay entities
Show text entities Show text entities
== ==
Opacity
==
Show others (own team only) Show others (own team only)
== ==
Show quads Show quads
== ==
Quads are used for background decoration
==
AntiPing AntiPing
== ==
Tries to predict other entities to give a feel of low latency
==
AntiPing: predict other players AntiPing: predict other players
== ==
@ -1301,6 +1322,12 @@ Update failed! Check log...
Restart Restart
== ==
Super
==
Team %d
==
Manual Manual
== ==

View file

@ -1362,3 +1362,30 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== No se pudo encontrar un servidor Tutorial == No se pudo encontrar un servidor Tutorial
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Allows maps to render with more detail
==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Super
==
Team %d
==

View file

@ -1333,6 +1333,15 @@ Join Tutorial Server
Skip Tutorial Skip Tutorial
== ==
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1348,8 +1357,26 @@ Graphics cards
auto auto
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Tutorial Tutorial
== ==
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -1362,5 +1362,32 @@ auto
Tutorial Tutorial
== 進入教學 == 進入教學
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Allows maps to render with more detail
==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -1197,9 +1197,15 @@ Config directory
Themes directory Themes directory
== ==
Toggle to edit your dummy settings
==
Download skins Download skins
== ==
Choose default eyes when joining a server
==
Skin Database Skin Database
== ==
@ -1224,6 +1230,9 @@ Windowed fullscreen
Desktop fullscreen Desktop fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1287,6 +1296,18 @@ Use old chat style
Preview Preview
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Show local player's key presses Show local player's key presses
== ==
@ -1356,3 +1377,9 @@ Editor
[Start menu] [Start menu]
Play Play
== ==
Super
==
Team %d
==

View file

@ -1322,9 +1322,18 @@ Settings file
Config directory Config directory
== ==
Toggle to edit your dummy settings
==
Choose default eyes when joining a server
==
Windowed fullscreen Windowed fullscreen
== ==
Allows maps to render with more detail
==
Renderer Renderer
== ==
@ -1340,6 +1349,18 @@ Graphics cards
auto auto
== ==
When you cross the start line, show a ghost tee replicating the movements of your best time
==
Opacity
==
Quads are used for background decoration
==
Tries to predict other entities to give a feel of low latency
==
Run on join Run on join
== ==
@ -1351,3 +1372,9 @@ Tutorial
Can't find a Tutorial server Can't find a Tutorial server
== ==
Super
==
Team %d
==

View file

@ -259,6 +259,10 @@ container.images.Add(image_strongweak)
container.pickups.Add(Pickup("health")) container.pickups.Add(Pickup("health"))
container.pickups.Add(Pickup("armor")) container.pickups.Add(Pickup("armor"))
container.pickups.Add(Pickup("armor_shotgun"))
container.pickups.Add(Pickup("armor_grenade"))
container.pickups.Add(Pickup("armor_laser"))
container.pickups.Add(Pickup("armor_ninja"))
container.pickups.Add(Pickup("weapon")) container.pickups.Add(Pickup("weapon"))
container.pickups.Add(Pickup("ninja", 90, 90)) container.pickups.Add(Pickup("ninja", 90, 90))
@ -358,6 +362,10 @@ container.sprites.Add(Sprite("weapon_ninja_muzzle3", set_game, 25,8,7,4))
container.sprites.Add(Sprite("pickup_health", set_game, 10,2,2,2)) container.sprites.Add(Sprite("pickup_health", set_game, 10,2,2,2))
container.sprites.Add(Sprite("pickup_armor", set_game, 12,2,2,2)) container.sprites.Add(Sprite("pickup_armor", set_game, 12,2,2,2))
container.sprites.Add(Sprite("pickup_armor_shotgun", set_game, 15,2,2,2))
container.sprites.Add(Sprite("pickup_armor_grenade", set_game, 17,2,2,2))
container.sprites.Add(Sprite("pickup_armor_laser", set_game, 19,2,2,2))
container.sprites.Add(Sprite("pickup_armor_ninja", set_game, 19,4,2,2))
container.sprites.Add(Sprite("pickup_weapon", set_game, 3,0,6,2)) container.sprites.Add(Sprite("pickup_weapon", set_game, 3,0,6,2))
container.sprites.Add(Sprite("pickup_ninja", set_game, 2,10,8,2)) container.sprites.Add(Sprite("pickup_ninja", set_game, 2,10,8,2))

View file

@ -34,7 +34,7 @@ ProjectileFlags = ["CLIENTID_BIT{}".format(i) for i in range(8)] + [
Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"] Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"]
Powerups = ["HEALTH", "ARMOR", "WEAPON", "NINJA"] Powerups = ["HEALTH", "ARMOR", "WEAPON", "NINJA", "ARMOR_SHOTGUN", "ARMOR_GRENADE", "ARMOR_NINJA", "ARMOR_LASER"]
Authed = ["NO", "HELPER", "MOD", "ADMIN"] Authed = ["NO", "HELPER", "MOD", "ADMIN"]
EntityClasses = ["PROJECTILE", "DOOR", "DRAGGER_WEAK", "DRAGGER_NORMAL", "DRAGGER_STRONG", "GUN_NORMAL", "GUN_EXPLOSIVE", "GUN_FREEZE", "GUN_UNFREEZE", "LIGHT", "PICKUP"] EntityClasses = ["PROJECTILE", "DOOR", "DRAGGER_WEAK", "DRAGGER_NORMAL", "DRAGGER_STRONG", "GUN_NORMAL", "GUN_EXPLOSIVE", "GUN_FREEZE", "GUN_UNFREEZE", "LIGHT", "PICKUP"]

View file

@ -3,19 +3,11 @@
#ifndef BASE_MATH_H #ifndef BASE_MATH_H
#define BASE_MATH_H #define BASE_MATH_H
#include <algorithm>
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
template<typename T> using std::clamp;
constexpr inline T clamp(T val, T min, T max)
{
return val < min ? min : (val > max ? max : val);
}
constexpr inline float sign(float f)
{
return f < 0.0f ? -1.0f : 1.0f;
}
constexpr inline int round_to_int(float f) constexpr inline int round_to_int(float f)
{ {
@ -65,17 +57,6 @@ constexpr inline int fx2i(int v)
return v / fxpscale; return v / fxpscale;
} }
inline int gcd(int a, int b)
{
while(b != 0)
{
int c = a % b;
a = b;
b = c;
}
return a;
}
class fxp class fxp
{ {
int value; int value;

View file

@ -1470,12 +1470,14 @@ void CGraphics_Threaded::QuadContainerUpload(int ContainerIndex)
} }
} }
void CGraphics_Threaded::QuadContainerAddQuads(int ContainerIndex, CQuadItem *pArray, int Num) int CGraphics_Threaded::QuadContainerAddQuads(int ContainerIndex, CQuadItem *pArray, int Num)
{ {
SQuadContainer &Container = m_QuadContainers[ContainerIndex]; SQuadContainer &Container = m_QuadContainers[ContainerIndex];
if((int)Container.m_Quads.size() > Num + CCommandBuffer::CCommandBuffer::MAX_VERTICES) if((int)Container.m_Quads.size() > Num + CCommandBuffer::CCommandBuffer::MAX_VERTICES)
return; return -1;
int RetOff = (int)Container.m_Quads.size();
for(int i = 0; i < Num; ++i) for(int i = 0; i < Num; ++i)
{ {
@ -1514,14 +1516,18 @@ void CGraphics_Threaded::QuadContainerAddQuads(int ContainerIndex, CQuadItem *pA
if(Container.m_AutomaticUpload) if(Container.m_AutomaticUpload)
QuadContainerUpload(ContainerIndex); QuadContainerUpload(ContainerIndex);
return RetOff;
} }
void CGraphics_Threaded::QuadContainerAddQuads(int ContainerIndex, CFreeformItem *pArray, int Num) int CGraphics_Threaded::QuadContainerAddQuads(int ContainerIndex, CFreeformItem *pArray, int Num)
{ {
SQuadContainer &Container = m_QuadContainers[ContainerIndex]; SQuadContainer &Container = m_QuadContainers[ContainerIndex];
if((int)Container.m_Quads.size() > Num + CCommandBuffer::CCommandBuffer::MAX_VERTICES) if((int)Container.m_Quads.size() > Num + CCommandBuffer::CCommandBuffer::MAX_VERTICES)
return; return -1;
int RetOff = (int)Container.m_Quads.size();
for(int i = 0; i < Num; ++i) for(int i = 0; i < Num; ++i)
{ {
@ -1551,6 +1557,8 @@ void CGraphics_Threaded::QuadContainerAddQuads(int ContainerIndex, CFreeformItem
if(Container.m_AutomaticUpload) if(Container.m_AutomaticUpload)
QuadContainerUpload(ContainerIndex); QuadContainerUpload(ContainerIndex);
return RetOff;
} }
void CGraphics_Threaded::QuadContainerReset(int ContainerIndex) void CGraphics_Threaded::QuadContainerReset(int ContainerIndex)

View file

@ -1141,8 +1141,8 @@ public:
int CreateQuadContainer(bool AutomaticUpload = true) override; int CreateQuadContainer(bool AutomaticUpload = true) override;
void QuadContainerChangeAutomaticUpload(int ContainerIndex, bool AutomaticUpload) override; void QuadContainerChangeAutomaticUpload(int ContainerIndex, bool AutomaticUpload) override;
void QuadContainerUpload(int ContainerIndex) override; void QuadContainerUpload(int ContainerIndex) override;
void QuadContainerAddQuads(int ContainerIndex, CQuadItem *pArray, int Num) override; int QuadContainerAddQuads(int ContainerIndex, CQuadItem *pArray, int Num) override;
void QuadContainerAddQuads(int ContainerIndex, CFreeformItem *pArray, int Num) override; int QuadContainerAddQuads(int ContainerIndex, CFreeformItem *pArray, int Num) override;
void QuadContainerReset(int ContainerIndex) override; void QuadContainerReset(int ContainerIndex) override;
void DeleteQuadContainer(int ContainerIndex) override; void DeleteQuadContainer(int ContainerIndex) override;
void RenderQuadContainer(int ContainerIndex, int QuadDrawNum) override; void RenderQuadContainer(int ContainerIndex, int QuadDrawNum) override;

View file

@ -422,8 +422,8 @@ public:
virtual int CreateQuadContainer(bool AutomaticUpload = true) = 0; virtual int CreateQuadContainer(bool AutomaticUpload = true) = 0;
virtual void QuadContainerChangeAutomaticUpload(int ContainerIndex, bool AutomaticUpload) = 0; virtual void QuadContainerChangeAutomaticUpload(int ContainerIndex, bool AutomaticUpload) = 0;
virtual void QuadContainerUpload(int ContainerIndex) = 0; virtual void QuadContainerUpload(int ContainerIndex) = 0;
virtual void QuadContainerAddQuads(int ContainerIndex, CQuadItem *pArray, int Num) = 0; virtual int QuadContainerAddQuads(int ContainerIndex, CQuadItem *pArray, int Num) = 0;
virtual void QuadContainerAddQuads(int ContainerIndex, CFreeformItem *pArray, int Num) = 0; virtual int QuadContainerAddQuads(int ContainerIndex, CFreeformItem *pArray, int Num) = 0;
virtual void QuadContainerReset(int ContainerIndex) = 0; virtual void QuadContainerReset(int ContainerIndex) = 0;
virtual void DeleteQuadContainer(int ContainerIndex) = 0; virtual void DeleteQuadContainer(int ContainerIndex) = 0;
virtual void RenderQuadContainer(int ContainerIndex, int QuadDrawNum) = 0; virtual void RenderQuadContainer(int ContainerIndex, int QuadDrawNum) = 0;

View file

@ -10,6 +10,10 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#ifndef LIBMARIADB
typedef bool my_bool;
#endif
enum enum
{ {
MYSQLSTATE_UNINITIALIZED, MYSQLSTATE_UNINITIALIZED,

View file

@ -37,7 +37,7 @@ class CSnapIDPool
{ {
enum enum
{ {
MAX_IDS = 16 * 1024, MAX_IDS = 32 * 1024,
}; };
class CID class CID

View file

@ -141,7 +141,11 @@ void CItems::RenderPickup(const CNetObj_Pickup *pPrev, const CNetObj_Pickup *pCu
SPRITE_PICKUP_HEALTH, SPRITE_PICKUP_HEALTH,
SPRITE_PICKUP_ARMOR, SPRITE_PICKUP_ARMOR,
SPRITE_PICKUP_WEAPON, SPRITE_PICKUP_WEAPON,
SPRITE_PICKUP_NINJA}; SPRITE_PICKUP_NINJA,
SPRITE_PICKUP_ARMOR_SHOTGUN,
SPRITE_PICKUP_ARMOR_GRENADE,
SPRITE_PICKUP_ARMOR_NINJA,
SPRITE_PICKUP_ARMOR_LASER};
int CurWeapon = clamp(pCurrent->m_Subtype, 0, NUM_WEAPONS - 1); int CurWeapon = clamp(pCurrent->m_Subtype, 0, NUM_WEAPONS - 1);
@ -149,6 +153,14 @@ void CItems::RenderPickup(const CNetObj_Pickup *pPrev, const CNetObj_Pickup *pCu
Graphics()->TextureSet(GameClient()->m_GameSkin.m_SpritePickupHealth); Graphics()->TextureSet(GameClient()->m_GameSkin.m_SpritePickupHealth);
else if(c[pCurrent->m_Type] == SPRITE_PICKUP_ARMOR) else if(c[pCurrent->m_Type] == SPRITE_PICKUP_ARMOR)
Graphics()->TextureSet(GameClient()->m_GameSkin.m_SpritePickupArmor); Graphics()->TextureSet(GameClient()->m_GameSkin.m_SpritePickupArmor);
else if(c[pCurrent->m_Type] == SPRITE_PICKUP_ARMOR_SHOTGUN)
Graphics()->TextureSet(GameClient()->m_GameSkin.m_SpritePickupArmorShotgun);
else if(c[pCurrent->m_Type] == SPRITE_PICKUP_ARMOR_GRENADE)
Graphics()->TextureSet(GameClient()->m_GameSkin.m_SpritePickupArmorGrenade);
else if(c[pCurrent->m_Type] == SPRITE_PICKUP_ARMOR_LASER)
Graphics()->TextureSet(GameClient()->m_GameSkin.m_SpritePickupArmorLaser);
else if(c[pCurrent->m_Type] == SPRITE_PICKUP_ARMOR_NINJA)
Graphics()->TextureSet(GameClient()->m_GameSkin.m_SpritePickupArmorNinja);
else if(c[pCurrent->m_Type] == SPRITE_PICKUP_WEAPON) else if(c[pCurrent->m_Type] == SPRITE_PICKUP_WEAPON)
{ {
Graphics()->TextureSet(GameClient()->m_GameSkin.m_SpritePickupWeapons[CurWeapon]); Graphics()->TextureSet(GameClient()->m_GameSkin.m_SpritePickupWeapons[CurWeapon]);
@ -178,6 +190,10 @@ void CItems::RenderPickup(const CNetObj_Pickup *pPrev, const CNetObj_Pickup *pCu
m_pClient->m_Effects.PowerupShine(Pos, vec2(96, 18)); m_pClient->m_Effects.PowerupShine(Pos, vec2(96, 18));
Pos.x -= 10.0f; Pos.x -= 10.0f;
} }
else if(c[pCurrent->m_Type] >= SPRITE_PICKUP_ARMOR_SHOTGUN && c[pCurrent->m_Type] <= SPRITE_PICKUP_ARMOR_NINJA)
{
QuadOffset = m_WeaponArmorQuadOffset + (c[pCurrent->m_Type] - SPRITE_PICKUP_ARMOR_SHOTGUN);
}
} }
Graphics()->QuadsSetRotation(Angle); Graphics()->QuadsSetRotation(Angle);
@ -549,6 +565,19 @@ void CItems::OnInit()
Graphics()->QuadsSetSubset(0, 0, 1, 1); Graphics()->QuadsSetSubset(0, 0, 1, 1);
RenderTools()->QuadContainerAddSprite(m_ItemsQuadContainerIndex, 24.f); RenderTools()->QuadContainerAddSprite(m_ItemsQuadContainerIndex, 24.f);
RenderTools()->GetSpriteScale(SPRITE_PICKUP_ARMOR_SHOTGUN, ScaleX, ScaleY);
Graphics()->QuadsSetSubset(0, 0, 1, 1);
m_WeaponArmorQuadOffset = RenderTools()->QuadContainerAddSprite(m_ItemsQuadContainerIndex, 64.f * ScaleX, 64.f * ScaleY);
RenderTools()->GetSpriteScale(SPRITE_PICKUP_ARMOR_GRENADE, ScaleX, ScaleY);
Graphics()->QuadsSetSubset(0, 0, 1, 1);
RenderTools()->QuadContainerAddSprite(m_ItemsQuadContainerIndex, 64.f * ScaleX, 64.f * ScaleY);
RenderTools()->GetSpriteScale(SPRITE_PICKUP_ARMOR_NINJA, ScaleX, ScaleY);
Graphics()->QuadsSetSubset(0, 0, 1, 1);
RenderTools()->QuadContainerAddSprite(m_ItemsQuadContainerIndex, 64.f * ScaleX, 64.f * ScaleY);
RenderTools()->GetSpriteScale(SPRITE_PICKUP_ARMOR_LASER, ScaleX, ScaleY);
Graphics()->QuadsSetSubset(0, 0, 1, 1);
RenderTools()->QuadContainerAddSprite(m_ItemsQuadContainerIndex, 64.f * ScaleX, 64.f * ScaleY);
Graphics()->QuadContainerUpload(m_ItemsQuadContainerIndex); Graphics()->QuadContainerUpload(m_ItemsQuadContainerIndex);
} }

View file

@ -15,6 +15,8 @@ class CItems : public CComponent
int m_ItemsQuadContainerIndex; int m_ItemsQuadContainerIndex;
int m_WeaponArmorQuadOffset = 0;
public: public:
virtual int Sizeof() const override { return sizeof(*this); } virtual int Sizeof() const override { return sizeof(*this); }
virtual void OnRender() override; virtual void OnRender() override;

View file

@ -36,6 +36,7 @@
#include <vector> #include <vector>
#include <array> #include <array>
#include <numeric>
CMenusKeyBinder CMenus::m_Binder; CMenusKeyBinder CMenus::m_Binder;
@ -531,7 +532,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
{ {
m_Dummy ^= 1; m_Dummy ^= 1;
} }
GameClient()->m_Tooltips.DoToolTip(&m_Dummy, &DummyLabel, Localize("Toggle to edit your dummy settings.")); GameClient()->m_Tooltips.DoToolTip(&m_Dummy, &DummyLabel, Localize("Toggle to edit your dummy settings"));
Dummy.HSplitTop(20.0f, &DummyLabel, &Dummy); Dummy.HSplitTop(20.0f, &DummyLabel, &Dummy);
@ -639,7 +640,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
GameClient()->m_Emoticon.EyeEmote(CurrentEyeEmote); GameClient()->m_Emoticon.EyeEmote(CurrentEyeEmote);
} }
} }
GameClient()->m_Tooltips.DoToolTip(&s_aEyesToolTip[CurrentEyeEmote], &EyesTee, Localize("Choose default eyes when joining a server.")); GameClient()->m_Tooltips.DoToolTip(&s_aEyesToolTip[CurrentEyeEmote], &EyesTee, Localize("Choose default eyes when joining a server"));
RenderTools()->RenderTee(pIdleState, &OwnSkinInfo, CurrentEyeEmote, vec2(1, 0), vec2(EyesTee.x + 25.0f, EyesTee.y + EyesTee.h / 2.0f + OffsetToMid.y)); RenderTools()->RenderTee(pIdleState, &OwnSkinInfo, CurrentEyeEmote, vec2(1, 0), vec2(EyesTee.x + 25.0f, EyesTee.y + EyesTee.h / 2.0f + OffsetToMid.y));
} }
@ -1212,7 +1213,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
static const float sc_FontSizeResList = 10.0f; static const float sc_FontSizeResList = 10.0f;
int OldSelected = -1; int OldSelected = -1;
{ {
int G = gcd(g_Config.m_GfxScreenWidth, g_Config.m_GfxScreenHeight); int G = std::gcd(g_Config.m_GfxScreenWidth, g_Config.m_GfxScreenHeight);
str_format(aBuf, sizeof(aBuf), "%s: %dx%d @%dhz %d bit (%d:%d)", Localize("Current"), int(g_Config.m_GfxScreenWidth * Graphics()->ScreenHiDPIScale()), int(g_Config.m_GfxScreenHeight * Graphics()->ScreenHiDPIScale()), g_Config.m_GfxScreenRefreshRate, g_Config.m_GfxColorDepth, g_Config.m_GfxScreenWidth / G, g_Config.m_GfxScreenHeight / G); str_format(aBuf, sizeof(aBuf), "%s: %dx%d @%dhz %d bit (%d:%d)", Localize("Current"), int(g_Config.m_GfxScreenWidth * Graphics()->ScreenHiDPIScale()), int(g_Config.m_GfxScreenHeight * Graphics()->ScreenHiDPIScale()), g_Config.m_GfxScreenRefreshRate, g_Config.m_GfxColorDepth, g_Config.m_GfxScreenWidth / G, g_Config.m_GfxScreenHeight / G);
} }
@ -1233,7 +1234,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
CListboxItem Item = UiDoListboxNextItem(&s_aModes[i], OldSelected == i); CListboxItem Item = UiDoListboxNextItem(&s_aModes[i], OldSelected == i);
if(Item.m_Visible) if(Item.m_Visible)
{ {
int G = gcd(s_aModes[i].m_CanvasWidth, s_aModes[i].m_CanvasHeight); int G = std::gcd(s_aModes[i].m_CanvasWidth, s_aModes[i].m_CanvasHeight);
str_format(aBuf, sizeof(aBuf), " %dx%d @%dhz %d bit (%d:%d)", s_aModes[i].m_CanvasWidth, s_aModes[i].m_CanvasHeight, s_aModes[i].m_RefreshRate, Depth, s_aModes[i].m_CanvasWidth / G, s_aModes[i].m_CanvasHeight / G); str_format(aBuf, sizeof(aBuf), " %dx%d @%dhz %d bit (%d:%d)", s_aModes[i].m_CanvasWidth, s_aModes[i].m_CanvasHeight, s_aModes[i].m_RefreshRate, Depth, s_aModes[i].m_CanvasWidth / G, s_aModes[i].m_CanvasHeight / G);
UI()->DoLabelScaled(&Item.m_Rect, aBuf, sc_FontSizeResList, TEXTALIGN_LEFT); UI()->DoLabelScaled(&Item.m_Rect, aBuf, sc_FontSizeResList, TEXTALIGN_LEFT);
} }
@ -1347,7 +1348,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
MainView.HSplitTop(20.0f, &Button, &MainView); MainView.HSplitTop(20.0f, &Button, &MainView);
if(DoButton_CheckBox(&g_Config.m_GfxHighDetail, Localize("High Detail"), g_Config.m_GfxHighDetail, &Button)) if(DoButton_CheckBox(&g_Config.m_GfxHighDetail, Localize("High Detail"), g_Config.m_GfxHighDetail, &Button))
g_Config.m_GfxHighDetail ^= 1; g_Config.m_GfxHighDetail ^= 1;
GameClient()->m_Tooltips.DoToolTip(&g_Config.m_GfxHighDetail, &Button, Localize("Allows maps to render with more detail.")); GameClient()->m_Tooltips.DoToolTip(&g_Config.m_GfxHighDetail, &Button, Localize("Allows maps to render with more detail"));
MainView.HSplitTop(20.0f, &Button, &MainView); MainView.HSplitTop(20.0f, &Button, &MainView);
if(DoButton_CheckBox(&g_Config.m_GfxHighdpi, Localize("Use high DPI"), g_Config.m_GfxHighdpi, &Button)) if(DoButton_CheckBox(&g_Config.m_GfxHighdpi, Localize("Use high DPI"), g_Config.m_GfxHighdpi, &Button))
@ -2723,7 +2724,7 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView)
{ {
g_Config.m_ClRaceGhost ^= 1; g_Config.m_ClRaceGhost ^= 1;
} }
GameClient()->m_Tooltips.DoToolTip(&g_Config.m_ClRaceGhost, &Button, Localize("When you cross the start line, show a ghost tee replicating the movements of your best time.")); GameClient()->m_Tooltips.DoToolTip(&g_Config.m_ClRaceGhost, &Button, Localize("When you cross the start line, show a ghost tee replicating the movements of your best time"));
if(g_Config.m_ClRaceGhost) if(g_Config.m_ClRaceGhost)
{ {
@ -2812,7 +2813,7 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView)
{ {
g_Config.m_ClAntiPing ^= 1; g_Config.m_ClAntiPing ^= 1;
} }
GameClient()->m_Tooltips.DoToolTip(&g_Config.m_ClAntiPing, &Button, Localize("Tries to predict other entities to give a feel of low latency.")); GameClient()->m_Tooltips.DoToolTip(&g_Config.m_ClAntiPing, &Button, Localize("Tries to predict other entities to give a feel of low latency"));
if(g_Config.m_ClAntiPing) if(g_Config.m_ClAntiPing)
{ {

View file

@ -394,13 +394,19 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
{ {
if(m_pClient->m_Snap.m_aTeamSize[0] > 8) if(m_pClient->m_Snap.m_aTeamSize[0] > 8)
{ {
str_format(aBuf, sizeof(aBuf), "%d", DDTeam); if(DDTeam == TEAM_SUPER)
str_copy(aBuf, Localize("Super"), sizeof(aBuf));
else
str_format(aBuf, sizeof(aBuf), "%d", DDTeam);
TextRender()->SetCursor(&Cursor, x - 10.0f, y + Spacing + FontSize - (FontSize / 1.5f), FontSize / 1.5f, TEXTFLAG_RENDER | TEXTFLAG_STOP_AT_END); TextRender()->SetCursor(&Cursor, x - 10.0f, y + Spacing + FontSize - (FontSize / 1.5f), FontSize / 1.5f, TEXTFLAG_RENDER | TEXTFLAG_STOP_AT_END);
Cursor.m_LineWidth = NameLength + 3; Cursor.m_LineWidth = NameLength + 3;
} }
else else
{ {
str_format(aBuf, sizeof(aBuf), "Team %d", DDTeam); if(DDTeam == TEAM_SUPER)
str_copy(aBuf, Localize("Super"), sizeof(aBuf));
else
str_format(aBuf, sizeof(aBuf), Localize("Team %d"), DDTeam);
tw = TextRender()->TextWidth(0, FontSize, aBuf, -1, -1.0f); tw = TextRender()->TextWidth(0, FontSize, aBuf, -1, -1.0f);
TextRender()->SetCursor(&Cursor, ScoreOffset + w / 2.0f - tw / 2.0f, y + LineHeight, FontSize / 1.5f, TEXTFLAG_RENDER | TEXTFLAG_STOP_AT_END); TextRender()->SetCursor(&Cursor, ScoreOffset + w / 2.0f - tw / 2.0f, y + LineHeight, FontSize / 1.5f, TEXTFLAG_RENDER | TEXTFLAG_STOP_AT_END);
Cursor.m_LineWidth = NameLength + 3; Cursor.m_LineWidth = NameLength + 3;

View file

@ -2716,6 +2716,10 @@ void CGameClient::LoadGameSkin(const char *pPath, bool AsDir)
Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupHealth); Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupHealth);
Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupArmor); Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupArmor);
Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupArmorShotgun);
Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupArmorGrenade);
Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupArmorLaser);
Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupArmorNinja);
Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupGrenade); Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupGrenade);
Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupShotgun); Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupShotgun);
Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupLaser); Graphics()->UnloadTexture(&m_GameSkin.m_SpritePickupLaser);
@ -2849,6 +2853,10 @@ void CGameClient::LoadGameSkin(const char *pPath, bool AsDir)
// pickups // pickups
m_GameSkin.m_SpritePickupHealth = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_PICKUP_HEALTH]); m_GameSkin.m_SpritePickupHealth = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_PICKUP_HEALTH]);
m_GameSkin.m_SpritePickupArmor = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_PICKUP_ARMOR]); m_GameSkin.m_SpritePickupArmor = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_PICKUP_ARMOR]);
m_GameSkin.m_SpritePickupArmorShotgun = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_PICKUP_ARMOR_SHOTGUN]);
m_GameSkin.m_SpritePickupArmorGrenade = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_PICKUP_ARMOR_GRENADE]);
m_GameSkin.m_SpritePickupArmorLaser = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_PICKUP_ARMOR_LASER]);
m_GameSkin.m_SpritePickupArmorNinja = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_PICKUP_ARMOR_NINJA]);
m_GameSkin.m_SpritePickupGrenade = Graphics()->LoadSpriteTexture(ImgInfo, &client_data7::g_pData->m_aSprites[client_data7::SPRITE_PICKUP_GRENADE]); m_GameSkin.m_SpritePickupGrenade = Graphics()->LoadSpriteTexture(ImgInfo, &client_data7::g_pData->m_aSprites[client_data7::SPRITE_PICKUP_GRENADE]);
m_GameSkin.m_SpritePickupShotgun = Graphics()->LoadSpriteTexture(ImgInfo, &client_data7::g_pData->m_aSprites[client_data7::SPRITE_PICKUP_SHOTGUN]); m_GameSkin.m_SpritePickupShotgun = Graphics()->LoadSpriteTexture(ImgInfo, &client_data7::g_pData->m_aSprites[client_data7::SPRITE_PICKUP_SHOTGUN]);
m_GameSkin.m_SpritePickupLaser = Graphics()->LoadSpriteTexture(ImgInfo, &client_data7::g_pData->m_aSprites[client_data7::SPRITE_PICKUP_LASER]); m_GameSkin.m_SpritePickupLaser = Graphics()->LoadSpriteTexture(ImgInfo, &client_data7::g_pData->m_aSprites[client_data7::SPRITE_PICKUP_LASER]);

View file

@ -592,6 +592,10 @@ public:
// pickups // pickups
IGraphics::CTextureHandle m_SpritePickupHealth; IGraphics::CTextureHandle m_SpritePickupHealth;
IGraphics::CTextureHandle m_SpritePickupArmor; IGraphics::CTextureHandle m_SpritePickupArmor;
IGraphics::CTextureHandle m_SpritePickupArmorShotgun;
IGraphics::CTextureHandle m_SpritePickupArmorGrenade;
IGraphics::CTextureHandle m_SpritePickupArmorLaser;
IGraphics::CTextureHandle m_SpritePickupArmorNinja;
IGraphics::CTextureHandle m_SpritePickupGrenade; IGraphics::CTextureHandle m_SpritePickupGrenade;
IGraphics::CTextureHandle m_SpritePickupShotgun; IGraphics::CTextureHandle m_SpritePickupShotgun;
IGraphics::CTextureHandle m_SpritePickupLaser; IGraphics::CTextureHandle m_SpritePickupLaser;

View file

@ -50,6 +50,61 @@ void CPickup::Tick()
pChr->SetActiveWeapon(WEAPON_HAMMER); pChr->SetActiveWeapon(WEAPON_HAMMER);
break; break;
case POWERUP_ARMOR_SHOTGUN:
if(!GameWorld()->m_WorldConfig.m_IsDDRace || !GameWorld()->m_WorldConfig.m_PredictDDRace)
continue;
if(pChr->Team() == TEAM_SUPER)
continue;
if(pChr->GetWeaponGot(WEAPON_SHOTGUN))
{
pChr->SetWeaponGot(WEAPON_SHOTGUN, false);
pChr->SetWeaponAmmo(WEAPON_SHOTGUN, 0);
pChr->SetLastWeapon(WEAPON_GUN);
}
if(pChr->GetActiveWeapon() == WEAPON_SHOTGUN)
pChr->SetActiveWeapon(WEAPON_HAMMER);
break;
case POWERUP_ARMOR_GRENADE:
if(!GameWorld()->m_WorldConfig.m_IsDDRace || !GameWorld()->m_WorldConfig.m_PredictDDRace)
continue;
if(pChr->Team() == TEAM_SUPER)
continue;
if(pChr->GetWeaponGot(WEAPON_GRENADE))
{
pChr->SetWeaponGot(WEAPON_GRENADE, false);
pChr->SetWeaponAmmo(WEAPON_GRENADE, 0);
pChr->SetLastWeapon(WEAPON_GUN);
}
if(pChr->GetActiveWeapon() == WEAPON_GRENADE)
pChr->SetActiveWeapon(WEAPON_HAMMER);
break;
case POWERUP_ARMOR_NINJA:
if(!GameWorld()->m_WorldConfig.m_IsDDRace || !GameWorld()->m_WorldConfig.m_PredictDDRace)
continue;
if(pChr->Team() == TEAM_SUPER)
continue;
pChr->SetNinjaActivationDir(vec2(0, 0));
pChr->SetNinjaActivationTick(-500);
pChr->SetNinjaCurrentMoveTime(0);
break;
case POWERUP_ARMOR_LASER:
if(!GameWorld()->m_WorldConfig.m_IsDDRace || !GameWorld()->m_WorldConfig.m_PredictDDRace)
continue;
if(pChr->Team() == TEAM_SUPER)
continue;
if(pChr->GetWeaponGot(WEAPON_LASER))
{
pChr->SetWeaponGot(WEAPON_LASER, false);
pChr->SetWeaponAmmo(WEAPON_LASER, 0);
pChr->SetLastWeapon(WEAPON_GUN);
}
if(pChr->GetActiveWeapon() == WEAPON_LASER)
pChr->SetActiveWeapon(WEAPON_HAMMER);
break;
case POWERUP_WEAPON: case POWERUP_WEAPON:
if(m_Subtype >= 0 && m_Subtype < NUM_WEAPONS && (!pChr->GetWeaponGot(m_Subtype) || pChr->GetWeaponAmmo(m_Subtype) != -1)) if(m_Subtype >= 0 && m_Subtype < NUM_WEAPONS && (!pChr->GetWeaponGot(m_Subtype) || pChr->GetWeaponAmmo(m_Subtype) != -1))
pChr->GiveWeapon(m_Subtype); pChr->GiveWeapon(m_Subtype);

View file

@ -129,28 +129,28 @@ void CRenderTools::DrawSprite(float x, float y, float ScaledWidth, float ScaledH
Graphics()->QuadsDraw(&QuadItem, 1); Graphics()->QuadsDraw(&QuadItem, 1);
} }
void CRenderTools::QuadContainerAddSprite(int QuadContainerIndex, float x, float y, float Size) int CRenderTools::QuadContainerAddSprite(int QuadContainerIndex, float x, float y, float Size)
{ {
IGraphics::CQuadItem QuadItem(x, y, Size, Size); IGraphics::CQuadItem QuadItem(x, y, Size, Size);
Graphics()->QuadContainerAddQuads(QuadContainerIndex, &QuadItem, 1); return Graphics()->QuadContainerAddQuads(QuadContainerIndex, &QuadItem, 1);
} }
void CRenderTools::QuadContainerAddSprite(int QuadContainerIndex, float Size) int CRenderTools::QuadContainerAddSprite(int QuadContainerIndex, float Size)
{ {
IGraphics::CQuadItem QuadItem(-(Size) / 2.f, -(Size) / 2.f, (Size), (Size)); IGraphics::CQuadItem QuadItem(-(Size) / 2.f, -(Size) / 2.f, (Size), (Size));
Graphics()->QuadContainerAddQuads(QuadContainerIndex, &QuadItem, 1); return Graphics()->QuadContainerAddQuads(QuadContainerIndex, &QuadItem, 1);
} }
void CRenderTools::QuadContainerAddSprite(int QuadContainerIndex, float Width, float Height) int CRenderTools::QuadContainerAddSprite(int QuadContainerIndex, float Width, float Height)
{ {
IGraphics::CQuadItem QuadItem(-(Width) / 2.f, -(Height) / 2.f, (Width), (Height)); IGraphics::CQuadItem QuadItem(-(Width) / 2.f, -(Height) / 2.f, (Width), (Height));
Graphics()->QuadContainerAddQuads(QuadContainerIndex, &QuadItem, 1); return Graphics()->QuadContainerAddQuads(QuadContainerIndex, &QuadItem, 1);
} }
void CRenderTools::QuadContainerAddSprite(int QuadContainerIndex, float X, float Y, float Width, float Height) int CRenderTools::QuadContainerAddSprite(int QuadContainerIndex, float X, float Y, float Width, float Height)
{ {
IGraphics::CQuadItem QuadItem(X, Y, Width, Height); IGraphics::CQuadItem QuadItem(X, Y, Width, Height);
Graphics()->QuadContainerAddQuads(QuadContainerIndex, &QuadItem, 1); return Graphics()->QuadContainerAddQuads(QuadContainerIndex, &QuadItem, 1);
} }
void CRenderTools::DrawRoundRectExt(float x, float y, float w, float h, float r, int Corners) void CRenderTools::DrawRoundRectExt(float x, float y, float w, float h, float r, int Corners)

View file

@ -82,10 +82,10 @@ public:
void DrawSprite(float x, float y, float size); void DrawSprite(float x, float y, float size);
void DrawSprite(float x, float y, float ScaledWidth, float ScaledHeight); void DrawSprite(float x, float y, float ScaledWidth, float ScaledHeight);
void QuadContainerAddSprite(int QuadContainerIndex, float x, float y, float size); int QuadContainerAddSprite(int QuadContainerIndex, float x, float y, float size);
void QuadContainerAddSprite(int QuadContainerIndex, float size); int QuadContainerAddSprite(int QuadContainerIndex, float size);
void QuadContainerAddSprite(int QuadContainerIndex, float Width, float Height); int QuadContainerAddSprite(int QuadContainerIndex, float Width, float Height);
void QuadContainerAddSprite(int QuadContainerIndex, float X, float Y, float Width, float Height); int QuadContainerAddSprite(int QuadContainerIndex, float X, float Y, float Width, float Height);
// rects // rects
void DrawRoundRect(float x, float y, float w, float h, float r); void DrawRoundRect(float x, float y, float w, float h, float r);

View file

@ -402,6 +402,22 @@ const char *CEditor::Explain(int ExplanationID, int Tile, int Layer) //TODO: Add
if(Layer == LAYER_GAME || Layer == LAYER_FRONT || Layer == LAYER_SWITCH) if(Layer == LAYER_GAME || Layer == LAYER_FRONT || Layer == LAYER_SWITCH)
return "BULLET: Bounces off the walls without explosion. Touching the bullet works like FREEZE tile (freezes for 3 seconds by default)."; return "BULLET: Bounces off the walls without explosion. Touching the bullet works like FREEZE tile (freezes for 3 seconds by default).";
break; break;
case ENTITY_OFFSET + ENTITY_ARMOR_SHOTGUN:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT || Layer == LAYER_SWITCH)
return "SHOTGUN SHIELD: Takes shotgun away.";
break;
case ENTITY_OFFSET + ENTITY_ARMOR_GRENADE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT || Layer == LAYER_SWITCH)
return "GRENADE SHIELD: Takes grenade away.";
break;
case ENTITY_OFFSET + ENTITY_ARMOR_NINJA:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT || Layer == LAYER_SWITCH)
return "NINJA SHIELD: Takes ninja away.";
break;
case ENTITY_OFFSET + ENTITY_ARMOR_LASER:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT || Layer == LAYER_SWITCH)
return "LASER SHIELD: Takes laser away.";
break;
case ENTITY_OFFSET + ENTITY_DRAGGER_WEAK: case ENTITY_OFFSET + ENTITY_DRAGGER_WEAK:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT || Layer == LAYER_SWITCH) if(Layer == LAYER_GAME || Layer == LAYER_FRONT || Layer == LAYER_SWITCH)
return "DRAGGING LASER: Grabs and attracts the closest tee to it. Can't reach tees through walls and LASER BLOCKER. Weak."; return "DRAGGING LASER: Grabs and attracts the closest tee to it. Can't reach tees through walls and LASER BLOCKER. Weak.";

View file

@ -91,7 +91,7 @@ bool IsValidEntity(int Index)
Index -= ENTITY_OFFSET; Index -= ENTITY_OFFSET;
return ( return (
(Index >= ENTITY_SPAWN && Index <= ENTITY_LASER_O_FAST) || (Index >= ENTITY_SPAWN && Index <= ENTITY_LASER_O_FAST) ||
(Index >= ENTITY_PLASMAE && Index <= ENTITY_CRAZY_SHOTGUN) || (Index >= ENTITY_PLASMAE && Index <= ENTITY_ARMOR_LASER) ||
(Index >= ENTITY_DRAGGER_WEAK && Index <= ENTITY_DRAGGER_STRONG_NW) || (Index >= ENTITY_DRAGGER_WEAK && Index <= ENTITY_DRAGGER_STRONG_NW) ||
Index == ENTITY_DOOR); Index == ENTITY_DOOR);
} }

View file

@ -80,6 +80,11 @@ enum
//DDRace - Shotgun //DDRace - Shotgun
ENTITY_CRAZY_SHOTGUN_EX, ENTITY_CRAZY_SHOTGUN_EX,
ENTITY_CRAZY_SHOTGUN, ENTITY_CRAZY_SHOTGUN,
//DDNet - Removing specific weapon
ENTITY_ARMOR_SHOTGUN,
ENTITY_ARMOR_GRENADE,
ENTITY_ARMOR_NINJA,
ENTITY_ARMOR_LASER,
//DDRace - Draggers //DDRace - Draggers
ENTITY_DRAGGER_WEAK = 42, ENTITY_DRAGGER_WEAK = 42,
ENTITY_DRAGGER_NORMAL, ENTITY_DRAGGER_NORMAL,

View file

@ -95,6 +95,56 @@ void CPickup::Tick()
pChr->SetActiveWeapon(WEAPON_HAMMER); pChr->SetActiveWeapon(WEAPON_HAMMER);
break; break;
case POWERUP_ARMOR_SHOTGUN:
if(pChr->Team() == TEAM_SUPER)
continue;
if(pChr->GetWeaponGot(WEAPON_SHOTGUN))
{
pChr->SetWeaponGot(WEAPON_SHOTGUN, false);
pChr->SetWeaponAmmo(WEAPON_SHOTGUN, 0);
pChr->SetLastWeapon(WEAPON_GUN);
GameServer()->CreateSound(m_Pos, SOUND_PICKUP_ARMOR, pChr->TeamMask());
}
if(pChr->GetActiveWeapon() == WEAPON_SHOTGUN)
pChr->SetActiveWeapon(WEAPON_HAMMER);
break;
case POWERUP_ARMOR_GRENADE:
if(pChr->Team() == TEAM_SUPER)
continue;
if(pChr->GetWeaponGot(WEAPON_GRENADE))
{
pChr->SetWeaponGot(WEAPON_GRENADE, false);
pChr->SetWeaponAmmo(WEAPON_GRENADE, 0);
pChr->SetLastWeapon(WEAPON_GUN);
GameServer()->CreateSound(m_Pos, SOUND_PICKUP_ARMOR, pChr->TeamMask());
}
if(pChr->GetActiveWeapon() == WEAPON_GRENADE)
pChr->SetActiveWeapon(WEAPON_HAMMER);
break;
case POWERUP_ARMOR_NINJA:
if(pChr->Team() == TEAM_SUPER)
continue;
pChr->SetNinjaActivationDir(vec2(0, 0));
pChr->SetNinjaActivationTick(-500);
pChr->SetNinjaCurrentMoveTime(0);
break;
case POWERUP_ARMOR_LASER:
if(pChr->Team() == TEAM_SUPER)
continue;
if(pChr->GetWeaponGot(WEAPON_LASER))
{
pChr->SetWeaponGot(WEAPON_LASER, false);
pChr->SetWeaponAmmo(WEAPON_LASER, 0);
pChr->SetLastWeapon(WEAPON_GUN);
GameServer()->CreateSound(m_Pos, SOUND_PICKUP_ARMOR, pChr->TeamMask());
}
if(pChr->GetActiveWeapon() == WEAPON_LASER)
pChr->SetActiveWeapon(WEAPON_HAMMER);
break;
case POWERUP_WEAPON: case POWERUP_WEAPON:
if(m_Subtype >= 0 && m_Subtype < NUM_WEAPONS && (!pChr->GetWeaponGot(m_Subtype) || pChr->GetWeaponAmmo(m_Subtype) != -1)) if(m_Subtype >= 0 && m_Subtype < NUM_WEAPONS && (!pChr->GetWeaponGot(m_Subtype) || pChr->GetWeaponAmmo(m_Subtype) != -1))

View file

@ -278,6 +278,14 @@ bool IGameController::OnEntity(int Index, vec2 Pos, int Layer, int Flags, int Nu
if(Index == ENTITY_ARMOR_1) if(Index == ENTITY_ARMOR_1)
Type = POWERUP_ARMOR; Type = POWERUP_ARMOR;
else if(Index == ENTITY_ARMOR_SHOTGUN)
Type = POWERUP_ARMOR_SHOTGUN;
else if(Index == ENTITY_ARMOR_GRENADE)
Type = POWERUP_ARMOR_GRENADE;
else if(Index == ENTITY_ARMOR_NINJA)
Type = POWERUP_ARMOR_NINJA;
else if(Index == ENTITY_ARMOR_LASER)
Type = POWERUP_ARMOR_LASER;
else if(Index == ENTITY_HEALTH_1) else if(Index == ENTITY_HEALTH_1)
Type = POWERUP_HEALTH; Type = POWERUP_HEALTH;
else if(Index == ENTITY_WEAPON_SHOTGUN) else if(Index == ENTITY_WEAPON_SHOTGUN)