mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge branch 'master' of git://github.com/oy/teeworlds into HEAD
Conflicts: bam.lua src/engine/console.h src/engine/server.h src/engine/server/server.cpp src/engine/shared/config.h src/engine/shared/config_variables.h src/engine/shared/console.cpp src/engine/shared/console.h src/game/client/components/binds.cpp src/game/client/components/chat.h src/game/client/components/console.cpp src/game/client/components/console.h src/game/client/components/controls.cpp src/game/client/components/emoticon.h src/game/client/components/maplayers.cpp src/game/client/components/menus.h src/game/client/components/scoreboard.h src/game/client/components/spectator.h src/game/client/components/voting.h src/game/client/gameclient.cpp src/game/client/gameclient.h src/game/client/render.h src/game/collision.cpp src/game/editor/ed_layer_tiles.cpp src/game/gamecore.cpp src/game/gamecore.h src/game/layers.cpp src/game/layers.h src/game/mapitems.h src/game/server/entities/character.cpp src/game/server/entities/laser.cpp src/game/server/entities/laser.h src/game/server/entities/pickup.cpp src/game/server/entities/pickup.h src/game/server/entities/projectile.cpp src/game/server/gamecontext.cpp src/game/server/gamecontroller.cpp src/game/server/gamecontroller.h src/game/server/gameworld.cpp src/game/server/gameworld.h src/game/server/player.cpp src/game/variables.h
This commit is contained in:
commit
0df6d0541f
16
bam.lua
16
bam.lua
|
@ -73,7 +73,7 @@ function Dat2c(datafile, sourcefile, arrayname)
|
|||
AddJob(
|
||||
sourcefile,
|
||||
"dat2c " .. PathFilename(sourcefile) .. " = " .. PathFilename(datafile),
|
||||
Script("scripts/dat2c.py").. "\" " .. sourcefile .. " " .. datafile .. " " .. arrayname
|
||||
Script("scripts/dat2c.py").. "\" " .. sourcefile .. " " .. datafile .. " " .. arrayname
|
||||
)
|
||||
AddDependency(sourcefile, datafile)
|
||||
return sourcefile
|
||||
|
@ -85,7 +85,7 @@ function ContentCompile(action, output)
|
|||
output,
|
||||
action .. " > " .. output,
|
||||
--Script("datasrc/compile.py") .. "\" ".. Path(output) .. " " .. action
|
||||
Script("datasrc/compile.py") .. " " .. action .. " > " .. Path(output)
|
||||
Script("datasrc/compile.py") .. " " .. action .. " > " .. Path(output)
|
||||
)
|
||||
AddDependency(output, Path("datasrc/content.py")) -- do this more proper
|
||||
AddDependency(output, Path("datasrc/network.py"))
|
||||
|
@ -155,7 +155,7 @@ function build(settings)
|
|||
settings.cc.includes:Add("other/mysql/include")
|
||||
|
||||
if family == "unix" then
|
||||
if platform == "macosx" then
|
||||
if platform == "macosx" then
|
||||
settings.link.frameworks:Add("Carbon")
|
||||
settings.link.frameworks:Add("AppKit")
|
||||
else
|
||||
|
@ -199,10 +199,10 @@ function build(settings)
|
|||
|
||||
if platform == "macosx" then
|
||||
client_settings.link.frameworks:Add("OpenGL")
|
||||
client_settings.link.frameworks:Add("AGL")
|
||||
client_settings.link.frameworks:Add("Carbon")
|
||||
client_settings.link.frameworks:Add("Cocoa")
|
||||
launcher_settings.link.frameworks:Add("Cocoa")
|
||||
client_settings.link.frameworks:Add("AGL")
|
||||
client_settings.link.frameworks:Add("Carbon")
|
||||
client_settings.link.frameworks:Add("Cocoa")
|
||||
launcher_settings.link.frameworks:Add("Cocoa")
|
||||
if not string.find(settings.config_name, "nosql") then
|
||||
if arch == "amd64" then
|
||||
server_settings.link.libpath:Add("other/mysql/mac/lib64")
|
||||
|
@ -357,7 +357,7 @@ else
|
|||
release_nosql_settings.cc.defines:Add("CONF_RELEASE")
|
||||
end
|
||||
|
||||
if platform == "macosx" and arch == "ia32" then
|
||||
if platform == "macosx" and arch == "ia32" then
|
||||
debug_settings_ppc = debug_settings:Copy()
|
||||
debug_settings_ppc.config_name = "debug_ppc"
|
||||
debug_settings_ppc.config_ext = "_ppc_d"
|
||||
|
|
BIN
data/audio/music_menu.wv
Normal file
BIN
data/audio/music_menu.wv
Normal file
Binary file not shown.
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -657,6 +657,15 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
Page %d of %d
|
||||
|
|
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
673
data/languages/danish.txt
Normal file
673
data/languages/danish.txt
Normal file
|
@ -0,0 +1,673 @@
|
|||
|
||||
##### translated strings #####
|
||||
|
||||
%d Bytes
|
||||
== %d Bytes
|
||||
|
||||
%d of %d servers, %d players
|
||||
== %d af %d servere, %d spillere
|
||||
|
||||
%d%% loaded
|
||||
== %d%% indlæst
|
||||
|
||||
%ds left
|
||||
== %d sekunder tilbage
|
||||
|
||||
%i minute left
|
||||
== %i minut tilbage
|
||||
|
||||
%i minutes left
|
||||
== %i minutter tilbage
|
||||
|
||||
%i second left
|
||||
== %i sekund tilbage
|
||||
|
||||
%i seconds left
|
||||
== %i sekunder tilbage
|
||||
|
||||
%s wins!
|
||||
== %s vinder!
|
||||
|
||||
-Page %d-
|
||||
== -Side %d-
|
||||
|
||||
Abort
|
||||
== Afbryd
|
||||
|
||||
Add
|
||||
== Tilføj
|
||||
|
||||
Add Friend
|
||||
== Tilføj ven
|
||||
|
||||
Address
|
||||
== Adresse
|
||||
|
||||
All
|
||||
== Alle
|
||||
|
||||
Alpha
|
||||
== Alpha
|
||||
|
||||
Always show name plates
|
||||
== Vis altid navneskilte
|
||||
|
||||
Are you sure that you want to delete the demo?
|
||||
== Er du sikker på at du vil slette denne demo?
|
||||
|
||||
Are you sure that you want to quit?
|
||||
== Er du sikker på at du vil afslutte?
|
||||
|
||||
Are you sure that you want to remove the player from your friends list?
|
||||
== Er du sikker på at du vil fjerne denne spiller fra din venneliste?
|
||||
|
||||
As this is the first time you launch the game, please enter your nick name below. It's recommended that you check the settings to adjust them to your liking before joining a server.
|
||||
== Siden dette er første gang du starter spillet, så vær så venlig at skrive dit navn nedenunder. Det anbefales at du kigger på indstillingerne så du kan tilpasse dem inden du kobler dig på en server.
|
||||
|
||||
Automatically record demos
|
||||
== Optag automatisk demoer
|
||||
|
||||
Automatically take game over screenshot
|
||||
== Tag automatisk et game over screenshot
|
||||
|
||||
Blue team
|
||||
== Blå hold
|
||||
|
||||
Blue team wins!
|
||||
== Blåt hold vinder!
|
||||
|
||||
Body
|
||||
== Krop
|
||||
|
||||
Call vote
|
||||
== Lav afstemning
|
||||
|
||||
Change settings
|
||||
== Ændre indstillinger
|
||||
|
||||
Chat
|
||||
== Chat
|
||||
|
||||
Clan
|
||||
== Klan
|
||||
|
||||
Client
|
||||
== Klient
|
||||
|
||||
Close
|
||||
== Luk
|
||||
|
||||
Compatible version
|
||||
== Kompatibel version
|
||||
|
||||
Connect
|
||||
== Tilslut
|
||||
|
||||
Connecting to
|
||||
== Forbinder til
|
||||
|
||||
Connection Problems...
|
||||
== Forbindelsesproblemer...
|
||||
|
||||
Console
|
||||
== Konsol
|
||||
|
||||
Controls
|
||||
== Taster
|
||||
|
||||
Count players only
|
||||
== Tæl kun spillere
|
||||
|
||||
Country
|
||||
== Land
|
||||
|
||||
Crc:
|
||||
== Crc:
|
||||
|
||||
Created:
|
||||
== Lavet:
|
||||
|
||||
Current
|
||||
== Nuværende
|
||||
|
||||
Current version: %s
|
||||
== Nuværende version: %s
|
||||
|
||||
Custom colors
|
||||
== Brugerdefinerede farver
|
||||
|
||||
Delete
|
||||
== Slet
|
||||
|
||||
Delete demo
|
||||
== Slet demo
|
||||
|
||||
Demo details
|
||||
== Demoinformation
|
||||
|
||||
Demos
|
||||
== Demoer
|
||||
|
||||
Disconnect
|
||||
== Frakoble
|
||||
|
||||
Disconnected
|
||||
== Frakoblet
|
||||
|
||||
Display Modes
|
||||
== Skærmopløsning
|
||||
|
||||
Downloading map
|
||||
== Downloader bane
|
||||
|
||||
Draw!
|
||||
== Uafgjort!
|
||||
|
||||
Dynamic Camera
|
||||
== Dynamisk kamera
|
||||
|
||||
Emoticon
|
||||
== Humørikoner
|
||||
|
||||
Enter
|
||||
== Fortsæt
|
||||
|
||||
Error
|
||||
== Fejl
|
||||
|
||||
Error loading demo
|
||||
== Kunne ikke ikke indlæse demoen
|
||||
|
||||
FSAA samples
|
||||
== FSAA samples
|
||||
|
||||
Favorite
|
||||
== Favorit
|
||||
|
||||
Favorites
|
||||
== Favoritter
|
||||
|
||||
Feet
|
||||
== Fødder
|
||||
|
||||
Filter
|
||||
== Filter
|
||||
|
||||
Fire
|
||||
== Skyd
|
||||
|
||||
Folder
|
||||
== Mappe
|
||||
|
||||
Force vote
|
||||
== Tving afstemning
|
||||
|
||||
Free-View
|
||||
== Free-View
|
||||
|
||||
Friends
|
||||
== Venner
|
||||
|
||||
Fullscreen
|
||||
== Fuldskærm
|
||||
|
||||
Game
|
||||
== Spil
|
||||
|
||||
Game info
|
||||
== Spil info
|
||||
|
||||
Game over
|
||||
== Game over
|
||||
|
||||
Game type
|
||||
== Spiltype
|
||||
|
||||
Game types:
|
||||
== Spiltyper:
|
||||
|
||||
General
|
||||
== Generelt
|
||||
|
||||
Graphics
|
||||
== Grafik
|
||||
|
||||
Grenade
|
||||
== Granatkaster
|
||||
|
||||
Hammer
|
||||
== Hammer
|
||||
|
||||
Has people playing
|
||||
== Har folk som spiller
|
||||
|
||||
High Detail
|
||||
== Extra detaljer
|
||||
|
||||
Hook
|
||||
== Krog
|
||||
|
||||
Host address
|
||||
== Værtsadresse
|
||||
|
||||
Hue
|
||||
== Farve
|
||||
|
||||
Info
|
||||
== Info
|
||||
|
||||
Internet
|
||||
== Internet
|
||||
|
||||
Invalid Demo
|
||||
== Ugyldig demo
|
||||
|
||||
Join blue
|
||||
== Spil for blå
|
||||
|
||||
Join game
|
||||
== Start spil
|
||||
|
||||
Join red
|
||||
== Spil for rød
|
||||
|
||||
Jump
|
||||
== Hop
|
||||
|
||||
Kick player
|
||||
== Udsmid spiller
|
||||
|
||||
LAN
|
||||
== LAN
|
||||
|
||||
Language
|
||||
== Sprog
|
||||
|
||||
Length:
|
||||
== Længde
|
||||
|
||||
Lht.
|
||||
== Lys
|
||||
|
||||
Loading
|
||||
== Indlæser
|
||||
|
||||
MOTD
|
||||
== MOTD
|
||||
|
||||
Map
|
||||
== Kort
|
||||
|
||||
Map:
|
||||
== Bane
|
||||
|
||||
Max Screenshots
|
||||
== Max antal screenshots
|
||||
|
||||
Max demos
|
||||
== Max antal demoer
|
||||
|
||||
Maximum ping:
|
||||
== Højeste ping:
|
||||
|
||||
Miscellaneous
|
||||
== Diverse
|
||||
|
||||
Mouse sens.
|
||||
== Musfølsomhed
|
||||
|
||||
Move left
|
||||
== Gå til venstre
|
||||
|
||||
Move player to spectators
|
||||
== Flyt spilleren til tilskuerne
|
||||
|
||||
Move right
|
||||
== Gå til højre
|
||||
|
||||
Movement
|
||||
== Bevægelse
|
||||
|
||||
Mute when not active
|
||||
== Ingen lyd når du ikke er aktiv
|
||||
|
||||
Name
|
||||
== Navn
|
||||
|
||||
Name plates size
|
||||
== Størrelse på navneskilte
|
||||
|
||||
Netversion:
|
||||
== Netversion:
|
||||
|
||||
New name:
|
||||
== Nyt navn:
|
||||
|
||||
News
|
||||
== Nyheder
|
||||
|
||||
Next weapon
|
||||
== Næste våben
|
||||
|
||||
Nickname
|
||||
== Navn
|
||||
|
||||
No
|
||||
== Nej
|
||||
|
||||
No password
|
||||
== Ingen adgangskode
|
||||
|
||||
No servers found
|
||||
== Ingen servere fundet
|
||||
|
||||
No servers match your filter criteria
|
||||
== Ingen servere matcher din filterkriterier
|
||||
|
||||
Ok
|
||||
== Ok
|
||||
|
||||
Open
|
||||
== Åben
|
||||
|
||||
Parent Folder
|
||||
== Overmappe
|
||||
|
||||
Password
|
||||
== Adgangskode
|
||||
|
||||
Password incorrect
|
||||
== Forkert adgangskode
|
||||
|
||||
Ping
|
||||
== Ping
|
||||
|
||||
Pistol
|
||||
== Pistol
|
||||
|
||||
Play
|
||||
== Spil
|
||||
|
||||
Player
|
||||
== Spiller
|
||||
|
||||
Player options
|
||||
== Spillermuligheder
|
||||
|
||||
Players
|
||||
== Spillere
|
||||
|
||||
Please balance teams!
|
||||
== Venligst balancerer hold!
|
||||
|
||||
Prev. weapon
|
||||
== Foregående våben
|
||||
|
||||
Quality Textures
|
||||
== Kvalitetsteksturer
|
||||
|
||||
Quick search:
|
||||
== Hurtig søg:
|
||||
|
||||
Quit
|
||||
== Afslut
|
||||
|
||||
Quit anyway?
|
||||
== Afslut alligevel?
|
||||
|
||||
REC %3d:%02d
|
||||
== REC %3d:%02d
|
||||
|
||||
Reason:
|
||||
== Grund:
|
||||
|
||||
Record demo
|
||||
== Optag demo
|
||||
|
||||
Red team
|
||||
== Rødt hold
|
||||
|
||||
Red team wins!
|
||||
== Rødt hold vinder!
|
||||
|
||||
Refresh
|
||||
== Opdater
|
||||
|
||||
Refreshing master servers
|
||||
== Opdaterer masterservere
|
||||
|
||||
Remote console
|
||||
== Serverkonsol
|
||||
|
||||
Remove
|
||||
== Fjern
|
||||
|
||||
Remove friend
|
||||
== Fjern ven
|
||||
|
||||
Rename
|
||||
== Omdøb navn
|
||||
|
||||
Rename demo
|
||||
== Omdøb navn på demoen
|
||||
|
||||
Reset filter
|
||||
== Nulstil filter
|
||||
|
||||
Reset to defaults
|
||||
== Sæt til standard
|
||||
|
||||
Rifle
|
||||
== Laser
|
||||
|
||||
Round
|
||||
== Runde
|
||||
|
||||
Sample rate
|
||||
== Sample frekvens
|
||||
|
||||
Sat.
|
||||
== Mætning
|
||||
|
||||
Score
|
||||
== Score
|
||||
|
||||
Score board
|
||||
== Resultatliste
|
||||
|
||||
Score limit
|
||||
== Score grænse
|
||||
|
||||
Scoreboard
|
||||
== Resultatliste
|
||||
|
||||
Screenshot
|
||||
== Screenshot
|
||||
|
||||
Server address:
|
||||
== Serveradresse
|
||||
|
||||
Server details
|
||||
== Serverdetaljer
|
||||
|
||||
Server filter
|
||||
== Serverfilter
|
||||
|
||||
Server info
|
||||
== Serverinfo
|
||||
|
||||
Server not full
|
||||
== Ikke fuld server
|
||||
|
||||
Settings
|
||||
== Indstillinger
|
||||
|
||||
Shotgun
|
||||
== Haglgevær
|
||||
|
||||
Show chat
|
||||
== Vis chat
|
||||
|
||||
Show friends
|
||||
== Vis venner
|
||||
|
||||
Show ingame HUD
|
||||
== Vis HUD i spillet
|
||||
|
||||
Show name plates
|
||||
== Vis navneskilte
|
||||
|
||||
Show only supported
|
||||
== Vis kun understøttede
|
||||
|
||||
Size:
|
||||
== Størrelse:
|
||||
|
||||
Skins
|
||||
== Udseende
|
||||
|
||||
Sound
|
||||
== Lyd
|
||||
|
||||
Sound error
|
||||
== Lyd fejl
|
||||
|
||||
Sound volume
|
||||
== Lydstyrke
|
||||
|
||||
Spectate
|
||||
== Kig på
|
||||
|
||||
Spectator mode
|
||||
== Tilskuer mode
|
||||
|
||||
Spectators
|
||||
== Tilskuer
|
||||
|
||||
Standard gametype
|
||||
== Standard spilletype
|
||||
|
||||
Standard map
|
||||
== Standard
|
||||
|
||||
Stop record
|
||||
== Stop optagelse
|
||||
|
||||
Sudden Death
|
||||
== Sudden Death
|
||||
|
||||
Switch weapon on pickup
|
||||
== Byt våben ved anskafning
|
||||
|
||||
Team
|
||||
== Hold
|
||||
|
||||
Team chat
|
||||
== Holdchat
|
||||
|
||||
Teeworlds %s is out! Download it at www.teeworlds.com!
|
||||
== Teeworld %s er ude nu! Download den på www.teeworlds.com!
|
||||
|
||||
Texture Compression
|
||||
== Teksturkompression
|
||||
|
||||
The audio device couldn't be initialised.
|
||||
== Lydenheden kunne ikke startes
|
||||
|
||||
The server is running a non-standard tuning on a pure game type.
|
||||
== Denne server kører på en ikke-standard tuning på en ren spilletype.
|
||||
|
||||
There's an unsaved map in the editor, you might want to save it before you quit the game.
|
||||
== Der er en ikke-gemt bane i editoren, vil du gemme den før du afslutter?
|
||||
|
||||
Time limit
|
||||
== Tidsbegrænsning
|
||||
|
||||
Time limit: %d min
|
||||
== Tidsbegrænsning: %d min
|
||||
|
||||
Try again
|
||||
== Forsøg igen
|
||||
|
||||
Type
|
||||
== Type
|
||||
|
||||
Type:
|
||||
== Type:
|
||||
|
||||
UI Color
|
||||
== Brugergrænsefladefarve
|
||||
|
||||
Unable to delete the demo
|
||||
== Kunne ikke slette demoen
|
||||
|
||||
Unable to rename the demo
|
||||
== Kunne omdøbe demoen
|
||||
|
||||
Use sounds
|
||||
== Anvend lydeffekter
|
||||
|
||||
Use team colors for name plates
|
||||
== Anvend holdfarver til navneskilte
|
||||
|
||||
V-Sync
|
||||
== V-Sync
|
||||
|
||||
Version
|
||||
== Version
|
||||
|
||||
Version:
|
||||
== Version:
|
||||
|
||||
Vote command:
|
||||
== Afstemningsordre:
|
||||
|
||||
Vote description:
|
||||
== Afstemningsbeskrivelse:
|
||||
|
||||
Vote no
|
||||
== Stem nej
|
||||
|
||||
Vote yes
|
||||
== Stem ja
|
||||
|
||||
Voting
|
||||
== Afstemning
|
||||
|
||||
Warmup
|
||||
== Opvarmning
|
||||
|
||||
Weapon
|
||||
== Våben
|
||||
|
||||
Welcome to Teeworlds
|
||||
== Velkommen til Teeworlds
|
||||
|
||||
Yes
|
||||
== Ja
|
||||
|
||||
You must restart the game for all settings to take effect.
|
||||
== Du skal genstarte spillet før alle indstillingerne virker.
|
||||
|
||||
Your skin
|
||||
== Dit udseende
|
||||
|
||||
no limit
|
||||
== Ingen grænse
|
||||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
##### translated strings #####
|
||||
==
|
||||
|
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -10,6 +10,9 @@ bulgarian
|
|||
czech
|
||||
== Česky
|
||||
|
||||
danish
|
||||
== Dansk
|
||||
|
||||
dutch
|
||||
== Nederlands
|
||||
|
||||
|
|
|
@ -588,6 +588,9 @@ Netversion:
|
|||
New name:
|
||||
==
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Player options
|
||||
==
|
||||
|
||||
|
@ -627,6 +630,12 @@ Size:
|
|||
Sound error
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
Spectator mode
|
||||
==
|
||||
|
||||
|
|
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -573,6 +573,9 @@ New name:
|
|||
Parent Folder
|
||||
==
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Player options
|
||||
==
|
||||
|
||||
|
@ -618,6 +621,12 @@ Size:
|
|||
Sound error
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
Spectator mode
|
||||
==
|
||||
|
||||
|
|
|
@ -657,5 +657,14 @@ no limit
|
|||
As this is the first time you launch the game, please enter your nick name below. It's recommended that you check the settings to adjust them to your liking before joining a server.
|
||||
==
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -573,6 +573,9 @@ Open
|
|||
Parent Folder
|
||||
==
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Player options
|
||||
==
|
||||
|
||||
|
@ -618,6 +621,12 @@ Size:
|
|||
Sound error
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
Spectator mode
|
||||
==
|
||||
|
||||
|
|
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -657,6 +657,15 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
Page %d of %d
|
||||
|
|
|
@ -657,5 +657,14 @@ no limit
|
|||
|
||||
##### needs translation #####
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
##### old translations #####
|
||||
|
||||
|
|
|
@ -585,6 +585,9 @@ New name:
|
|||
Parent Folder
|
||||
==
|
||||
|
||||
Play background music
|
||||
==
|
||||
|
||||
Player options
|
||||
==
|
||||
|
||||
|
@ -624,6 +627,12 @@ Size:
|
|||
Sound error
|
||||
==
|
||||
|
||||
Spectate next
|
||||
==
|
||||
|
||||
Spectate previous
|
||||
==
|
||||
|
||||
Spectator mode
|
||||
==
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ container.sounds.Add(SoundSet("player_pain_long", FileList("audio/vo_teefault_pa
|
|||
|
||||
container.sounds.Add(SoundSet("body_land", FileList("audio/foley_land-%02d.wv", 4)))
|
||||
container.sounds.Add(SoundSet("player_airjump", FileList("audio/foley_dbljump-%02d.wv", 3)))
|
||||
container.sounds.Add(SoundSet("player_jump", FileList("audio/foley_foot_left-%02d.wv", 4) + FileList("audio/foley_foot_right-%02d.wv", 4)))
|
||||
container.sounds.Add(SoundSet("player_jump", FileList("audio/foley_foot_left-%02d.wv", 4) + FileList("audio/foley_foot_right-%02d.wv", 4)))
|
||||
container.sounds.Add(SoundSet("player_die", FileList("audio/foley_body_splat-%02d.wv", 3)))
|
||||
container.sounds.Add(SoundSet("player_spawn", FileList("audio/vo_teefault_spawn-%02d.wv", 7)))
|
||||
container.sounds.Add(SoundSet("player_skid", FileList("audio/sfx_skid-%02d.wv", 4)))
|
||||
|
@ -221,6 +221,8 @@ container.sounds.Add(SoundSet("ctf_grab_pl", ["audio/sfx_ctf_grab_pl.wv"]))
|
|||
container.sounds.Add(SoundSet("ctf_grab_en", ["audio/sfx_ctf_grab_en.wv"]))
|
||||
container.sounds.Add(SoundSet("ctf_capture", ["audio/sfx_ctf_cap_pl.wv"]))
|
||||
|
||||
container.sounds.Add(SoundSet("menu", ["audio/music_menu.wv"]))
|
||||
|
||||
image_null = Image("null", "")
|
||||
image_particles = Image("particles", "particles.png")
|
||||
image_game = Image("game", "game.png")
|
||||
|
@ -429,35 +431,35 @@ anim.body.frames.Add(AnimKeyframe(0.6, 0, 0, 0))
|
|||
anim.body.frames.Add(AnimKeyframe(0.8, 0,-1, 0))
|
||||
anim.body.frames.Add(AnimKeyframe(1.0, 0, 0, 0))
|
||||
|
||||
anim.back_foot.frames.Add(AnimKeyframe(0.0, 8, 0, 0))
|
||||
anim.back_foot.frames.Add(AnimKeyframe(0.0, 8, 0, 0))
|
||||
anim.back_foot.frames.Add(AnimKeyframe(0.2, -8, 0, 0))
|
||||
anim.back_foot.frames.Add(AnimKeyframe(0.4,-10,-4, 0.2))
|
||||
anim.back_foot.frames.Add(AnimKeyframe(0.6, -8,-8, 0.3))
|
||||
anim.back_foot.frames.Add(AnimKeyframe(0.8, 4,-4,-0.2))
|
||||
anim.back_foot.frames.Add(AnimKeyframe(1.0, 8, 0, 0))
|
||||
anim.back_foot.frames.Add(AnimKeyframe(0.8, 4,-4,-0.2))
|
||||
anim.back_foot.frames.Add(AnimKeyframe(1.0, 8, 0, 0))
|
||||
|
||||
anim.front_foot.frames.Add(AnimKeyframe(0.0,-10,-4, 0.2))
|
||||
anim.front_foot.frames.Add(AnimKeyframe(0.2, -8,-8, 0.3))
|
||||
anim.front_foot.frames.Add(AnimKeyframe(0.4, 4,-4,-0.2))
|
||||
anim.front_foot.frames.Add(AnimKeyframe(0.6, 8, 0, 0))
|
||||
anim.front_foot.frames.Add(AnimKeyframe(0.8, 8, 0, 0))
|
||||
anim.front_foot.frames.Add(AnimKeyframe(0.4, 4,-4,-0.2))
|
||||
anim.front_foot.frames.Add(AnimKeyframe(0.6, 8, 0, 0))
|
||||
anim.front_foot.frames.Add(AnimKeyframe(0.8, 8, 0, 0))
|
||||
anim.front_foot.frames.Add(AnimKeyframe(1.0,-10,-4, 0.2))
|
||||
container.animations.Add(anim)
|
||||
|
||||
anim = Animation("hammer_swing")
|
||||
anim.attach.frames.Add(AnimKeyframe(0.0, 0, 0, -0.10))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.3, 0, 0, 0.25))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.4, 0, 0, 0.30))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.5, 0, 0, 0.25))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.3, 0, 0, 0.25))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.4, 0, 0, 0.30))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.5, 0, 0, 0.25))
|
||||
anim.attach.frames.Add(AnimKeyframe(1.0, 0, 0, -0.10))
|
||||
container.animations.Add(anim)
|
||||
|
||||
anim = Animation("ninja_swing")
|
||||
anim.attach.frames.Add(AnimKeyframe(0.00, 0, 0, -0.25))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.10, 0, 0, -0.05))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.15, 0, 0, 0.35))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.42, 0, 0, 0.40))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.50, 0, 0, 0.35))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.15, 0, 0, 0.35))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.42, 0, 0, 0.40))
|
||||
anim.attach.frames.Add(AnimKeyframe(0.50, 0, 0, 0.35))
|
||||
anim.attach.frames.Add(AnimKeyframe(1.00, 0, 0, -0.25))
|
||||
container.animations.Add(anim)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ PlayerFlags = ["PLAYING", "IN_MENU", "CHATTING", "SCOREBOARD"]
|
|||
GameFlags = ["TEAMS", "FLAGS"]
|
||||
GameStateFlags = ["GAMEOVER", "SUDDENDEATH", "PAUSED"]
|
||||
|
||||
Emoticons = [str(x) for x in range(0,16)]
|
||||
Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"]
|
||||
|
||||
Powerups = ["HEALTH", "ARMOR", "WEAPON", "NINJA"]
|
||||
|
||||
|
|
35
scripts/check_header_guards.py
Normal file
35
scripts/check_header_guards.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
import os
|
||||
|
||||
|
||||
PATH = "../src/"
|
||||
|
||||
|
||||
def check_file(filename):
|
||||
file = open(filename)
|
||||
while 1:
|
||||
line = file.readline()
|
||||
if len(line) == 0:
|
||||
break
|
||||
if line[0] == "/" or line[0] == "*" or line[0] == "\r" or line[0] == "\n" or line[0] == "\t":
|
||||
continue
|
||||
if line[:7] == "#ifndef":
|
||||
hg = "#ifndef " + ("_".join(filename.split(PATH)[1].split("/"))[:-2]).upper() + "_H"
|
||||
if line[:-1] != hg:
|
||||
print "Wrong header guard in " + filename
|
||||
else:
|
||||
print "Missing header guard in " + filename
|
||||
break
|
||||
file.close()
|
||||
|
||||
|
||||
|
||||
def check_dir(dir):
|
||||
list = os.listdir(dir)
|
||||
for file in list:
|
||||
if os.path.isdir(dir+file):
|
||||
if file != "external" and file != "generated":
|
||||
check_dir(dir+file+"/")
|
||||
elif file[-2:] == ".h" and file != "keynames.h":
|
||||
check_file(dir+file)
|
||||
|
||||
check_dir(PATH)
|
|
@ -29,5 +29,8 @@ for filename in sys.argv[1:]:
|
|||
f += cstrip([l.strip() for l in open(filename, "rb")])
|
||||
|
||||
hash = hashlib.md5(f).hexdigest().lower()[16:]
|
||||
#TODO 0.7: improve nethash creation
|
||||
if hash == "6e28a475de43adfd":
|
||||
hash = "626fce9a778df4d4"
|
||||
print('#define GAME_NETVERSION_HASH "%s"' % hash)
|
||||
print('#define GIT_SHORTREV_HASH "%s"' % os.popen('git rev-parse HEAD').readline(8))
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#ifndef BASELIB_FILE_CONFIG_H
|
||||
#define BASELIB_FILE_CONFIG_H
|
||||
#ifndef BASE_DETECT_H
|
||||
#define BASE_DETECT_H
|
||||
|
||||
/*
|
||||
this file detected the family, platform and architecture
|
||||
to compile for.
|
||||
this file detected the family, platform and architecture
|
||||
to compile for.
|
||||
*/
|
||||
|
||||
/* platforms */
|
||||
|
|
|
@ -1015,8 +1015,8 @@ NETSOCKET net_tcp_create(const NETADDR *a)
|
|||
bind(sock.ipv4sock, (struct sockaddr *)&addr, sizeof(addr));
|
||||
}
|
||||
|
||||
/* return */
|
||||
return sock;
|
||||
/* return */
|
||||
return sock;
|
||||
}
|
||||
|
||||
int net_tcp_set_non_blocking(NETSOCKET sock)
|
||||
|
@ -1132,7 +1132,7 @@ int net_tcp_connect_non_blocking(NETSOCKET sock, const NETADDR *a)
|
|||
/*
|
||||
netaddr_to_sockaddr(a, &addr);
|
||||
net_tcp_set_non_blocking(sock);
|
||||
res = connect(sock, &addr, sizeof(addr));
|
||||
res = connect(sock, &addr, sizeof(addr));
|
||||
net_tcp_set_blocking(sock);
|
||||
*/
|
||||
|
||||
|
@ -1387,16 +1387,16 @@ void swap_endian(void *data, unsigned elem_size, unsigned num)
|
|||
|
||||
int net_socket_read_wait(NETSOCKET sock, int time)
|
||||
{
|
||||
struct timeval tv;
|
||||
fd_set readfds;
|
||||
struct timeval tv;
|
||||
fd_set readfds;
|
||||
int sockid;
|
||||
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 1000*time;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 1000*time;
|
||||
sockid = 0;
|
||||
|
||||
FD_ZERO(&readfds);
|
||||
if(sock.ipv4sock >= 0)
|
||||
FD_ZERO(&readfds);
|
||||
if(sock.ipv4sock >= 0)
|
||||
{
|
||||
FD_SET(sock.ipv4sock, &readfds);
|
||||
sockid = sock.ipv4sock;
|
||||
|
@ -1408,8 +1408,8 @@ int net_socket_read_wait(NETSOCKET sock, int time)
|
|||
sockid = sock.ipv6sock;
|
||||
}
|
||||
|
||||
/* don't care about writefds and exceptfds */
|
||||
select(sockid+1, &readfds, NULL, NULL, &tv);
|
||||
/* don't care about writefds and exceptfds */
|
||||
select(sockid+1, &readfds, NULL, NULL, &tv);
|
||||
|
||||
if(sock.ipv4sock >= 0 && FD_ISSET(sock.ipv4sock, &readfds))
|
||||
return 1;
|
||||
|
@ -1417,7 +1417,7 @@ int net_socket_read_wait(NETSOCKET sock, int time)
|
|||
if(sock.ipv6sock >= 0 && FD_ISSET(sock.ipv6sock, &readfds))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned time_timestamp()
|
||||
|
@ -1458,12 +1458,12 @@ void str_format(char *buffer, int buffer_size, const char *format, ...)
|
|||
va_list ap;
|
||||
va_start(ap, format);
|
||||
_vsnprintf(buffer, buffer_size, format, ap);
|
||||
va_end(ap);
|
||||
va_end(ap);
|
||||
#else
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
vsnprintf(buffer, buffer_size, format, ap);
|
||||
va_end(ap);
|
||||
va_end(ap);
|
||||
#endif
|
||||
|
||||
buffer[buffer_size-1] = 0; /* assure null termination */
|
||||
|
@ -1710,7 +1710,7 @@ float str_tofloat(const char *str) { return atof(str); }
|
|||
|
||||
static int str_utf8_isstart(char c)
|
||||
{
|
||||
if((c&0xC0) == 0x80) /* 10xxxxxx */
|
||||
if((c&0xC0) == 0x80) /* 10xxxxxx */
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ extern "C" {
|
|||
<dbg_break>
|
||||
*/
|
||||
void dbg_assert(int test, const char *msg);
|
||||
#define dbg_assert(test,msg) dbg_assert_imp(__FILE__, __LINE__, test, msg)
|
||||
#define dbg_assert(test,msg) dbg_assert_imp(__FILE__, __LINE__, test, msg)
|
||||
void dbg_assert_imp(const char *filename, int line, int test, const char *msg);
|
||||
|
||||
/*
|
||||
|
@ -168,7 +168,7 @@ int mem_comp(const void *a, const void *b, int size);
|
|||
Will trigger a assert if memory has failed.
|
||||
*/
|
||||
int mem_check_imp();
|
||||
#define mem_check() dbg_assert_imp(__FILE__, __LINE__, mem_check_imp(), "Memory check failed")
|
||||
#define mem_check() dbg_assert_imp(__FILE__, __LINE__, mem_check_imp(), "Memory check failed")
|
||||
|
||||
/* Group: File IO */
|
||||
enum {
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#ifndef TL_FILE_ALGORITHM_HPP
|
||||
#define TL_FILE_ALGORITHM_HPP
|
||||
#ifndef BASE_TL_ALGORITHM_H
|
||||
#define BASE_TL_ALGORITHM_H
|
||||
|
||||
#include "range.h"
|
||||
|
||||
|
||||
/*
|
||||
insert 4
|
||||
v
|
||||
v
|
||||
1 2 3 4 5 6
|
||||
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#ifndef TL_FILE_ALLOCATOR_HPP
|
||||
#define TL_FILE_ALLOCATOR_HPP
|
||||
#ifndef BASE_TL_ALLOCATOR_H
|
||||
#define BASE_TL_ALLOCATOR_H
|
||||
|
||||
template <class T>
|
||||
class allocator_default
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#ifndef TL_FILE_ARRAY_HPP
|
||||
#define TL_FILE_ARRAY_HPP
|
||||
#ifndef BASE_TL_ARRAY_H
|
||||
#define BASE_TL_ARRAY_H
|
||||
|
||||
#include "range.h"
|
||||
#include "allocator.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#ifndef TL_FILE_BASE_HPP
|
||||
#define TL_FILE_BASE_HPP
|
||||
#ifndef BASE_TL_BASE_H
|
||||
#define BASE_TL_BASE_H
|
||||
|
||||
#include <base/system.h>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#ifndef TL_FILE_RANGE_HPP
|
||||
#define TL_FILE_RANGE_HPP
|
||||
#ifndef BASE_TL_RANGE_H
|
||||
#define BASE_TL_RANGE_H
|
||||
|
||||
#include "base.h"
|
||||
|
||||
|
@ -225,10 +225,10 @@ public:
|
|||
};
|
||||
|
||||
template<class R> reverse_range<R> reverse(R range) {
|
||||
return reverse_range<R>(range);
|
||||
return reverse_range<R>(range);
|
||||
}
|
||||
template<class R> R reverse(reverse_range<R> range) {
|
||||
return range.range;
|
||||
return range.range;
|
||||
}
|
||||
|
||||
#endif // TL_FILE_RANGE_HPP
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#ifndef TL_FILE_SORTED_ARRAY_HPP
|
||||
#define TL_FILE_SORTED_ARRAY_HPP
|
||||
#ifndef BASE_TL_SORTED_ARRAY_H
|
||||
#define BASE_TL_SORTED_ARRAY_H
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "array.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#ifndef TL_FILE_STRING_HPP
|
||||
#define TL_FILE_STRING_HPP
|
||||
#ifndef BASE_TL_STRING_H
|
||||
#define BASE_TL_STRING_H
|
||||
|
||||
#include "base.h"
|
||||
#include "allocator.h"
|
||||
|
|
|
@ -860,7 +860,7 @@ void CClient::DebugRender()
|
|||
total = 42
|
||||
*/
|
||||
FrameTimeAvg = FrameTimeAvg*0.9f + m_FrameTime*0.1f;
|
||||
str_format(aBuffer, sizeof(aBuffer), "ticks: %8d %8d mem %dk %d gfxmem: %dk fps: %3d",
|
||||
str_format(aBuffer, sizeof(aBuffer), "ticks: %8d %8d mem %dk %d gfxmem: %dk fps: %3d",
|
||||
m_CurGameTick, m_PredTick,
|
||||
mem_stats()->allocated/1024,
|
||||
mem_stats()->total_allocations,
|
||||
|
|
|
@ -449,7 +449,7 @@ void CGraphics_OpenGL::ScreenshotDirect(const char *pFilename)
|
|||
char aWholePath[1024];
|
||||
png_t Png; // ignore_convention
|
||||
|
||||
IOHANDLE File = m_pStorage->OpenFile(pFilename, IOFLAG_WRITE, IStorage::TYPE_SAVE, aWholePath, sizeof(aWholePath));
|
||||
IOHANDLE File = m_pStorage->OpenFile(pFilename, IOFLAG_WRITE, IStorage::TYPE_SAVE, aWholePath, sizeof(aWholePath));
|
||||
if(File)
|
||||
io_close(File);
|
||||
|
||||
|
@ -721,7 +721,7 @@ int CGraphics_SDL::TryInit()
|
|||
SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
|
||||
|
||||
// set flags
|
||||
Flags = SDL_OPENGL;
|
||||
Flags = SDL_OPENGL;
|
||||
Flags |= SDL_GL_DOUBLEBUFFER;
|
||||
Flags |= SDL_HWPALETTE;
|
||||
if(g_Config.m_DbgResizable)
|
||||
|
|
|
@ -154,7 +154,7 @@ int CInput::Update()
|
|||
// skip private use area of the BMP(contains the unicodes for keyboard function keys on MacOS)
|
||||
if(Event.key.keysym.unicode < 0xE000 || Event.key.keysym.unicode > 0xF8FF) // ignore_convention
|
||||
AddEvent(Event.key.keysym.unicode, 0, 0); // ignore_convention
|
||||
Key = Event.key.keysym.sym; // ignore_convention
|
||||
Key = Event.key.keysym.sym; // ignore_convention
|
||||
break;
|
||||
case SDL_KEYUP:
|
||||
Action = IInput::FLAG_RELEASE;
|
||||
|
|
|
@ -86,7 +86,7 @@ bool CServerBrowser::SortCompareName(int Index1, int Index2) const
|
|||
CServerEntry *a = m_ppServerlist[Index1];
|
||||
CServerEntry *b = m_ppServerlist[Index2];
|
||||
// make sure empty entries are listed last
|
||||
return (a->m_GotInfo && b->m_GotInfo) || (!a->m_GotInfo && !b->m_GotInfo) ? str_comp(a->m_Info.m_aName, b->m_Info.m_aName) < 0 :
|
||||
return (a->m_GotInfo && b->m_GotInfo) || (!a->m_GotInfo && !b->m_GotInfo) ? str_comp(a->m_Info.m_aName, b->m_Info.m_aName) < 0 :
|
||||
a->m_GotInfo ? true : false;
|
||||
}
|
||||
|
||||
|
@ -659,7 +659,7 @@ void CServerBrowser::AddFavorite(const NETADDR &Addr)
|
|||
if(pEntry)
|
||||
pEntry->m_Info.m_Favorite = 1;
|
||||
|
||||
if(g_Config.m_Debug)
|
||||
if(g_Config.m_Debug)
|
||||
{
|
||||
char aAddrStr[NETADDR_MAXSTRSIZE];
|
||||
net_addr_str(&Addr, aAddrStr, sizeof(aAddrStr));
|
||||
|
|
|
@ -157,8 +157,12 @@ static void Mix(short *pFinalOut, unsigned Frames)
|
|||
|
||||
// free voice if not used any more
|
||||
if(v->m_Tick == v->m_pSample->m_NumFrames)
|
||||
v->m_pSample = 0;
|
||||
|
||||
{
|
||||
if(v->m_Flags&ISound::FLAG_LOOP)
|
||||
v->m_Tick = 0;
|
||||
else
|
||||
v->m_pSample = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -463,11 +467,16 @@ int CSound::Play(int ChannelID, int SampleID, int Flags)
|
|||
return Play(ChannelID, SampleID, Flags, 0, 0);
|
||||
}
|
||||
|
||||
void CSound::Stop(int VoiceID)
|
||||
void CSound::Stop(int SampleID)
|
||||
{
|
||||
// TODO: a nice fade out
|
||||
lock_wait(m_SoundLock);
|
||||
m_aVoices[VoiceID].m_pSample = 0;
|
||||
CSample *pSample = &m_aSamples[SampleID];
|
||||
for(int i = 0; i < NUM_VOICES; i++)
|
||||
{
|
||||
if(m_aVoices[i].m_pSample == pSample)
|
||||
m_aVoices[i].m_pSample = 0;
|
||||
}
|
||||
lock_release(m_SoundLock);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
int Play(int ChannelID, int SampleID, int Flags, float x, float y);
|
||||
virtual int PlayAt(int ChannelID, int SampleID, int Flags, float x, float y);
|
||||
virtual int Play(int ChannelID, int SampleID, int Flags);
|
||||
virtual void Stop(int VoiceID);
|
||||
virtual void Stop(int SampleID);
|
||||
virtual void StopAll();
|
||||
};
|
||||
|
||||
|
|
|
@ -337,7 +337,7 @@ class CTextRender : public IEngineTextRender
|
|||
}
|
||||
else if(pBitmap->pixel_mode == FT_PIXEL_MODE_MONO) // ignore_convention
|
||||
{
|
||||
for(py = 0; py < pBitmap->rows; py++) // ignore_convention
|
||||
for(py = 0; py < pBitmap->rows; py++) // ignore_convention
|
||||
for(px = 0; px < pBitmap->width; px++) // ignore_convention
|
||||
{
|
||||
if(pBitmap->buffer[py*pBitmap->pitch+px/8]&(1<<(7-(px%8)))) // ignore_convention
|
||||
|
|
|
@ -981,25 +981,25 @@ void CServer::SendServerInfo(NETADDR *pAddr, int Token)
|
|||
|
||||
// flags
|
||||
int i = 0;
|
||||
if(g_Config.m_Password[0]) // password set
|
||||
if(g_Config.m_Password[0]) // password set
|
||||
i |= SERVER_FLAG_PASSWORD;
|
||||
str_format(aBuf, sizeof(aBuf), "%d", i);
|
||||
p.AddString(aBuf, 2);
|
||||
|
||||
str_format(aBuf, sizeof(aBuf), "%d", PlayerCount); p.AddString(aBuf, 3); // num players
|
||||
str_format(aBuf, sizeof(aBuf), "%d", PlayerCount); p.AddString(aBuf, 3); // num players
|
||||
str_format(aBuf, sizeof(aBuf), "%d", m_NetServer.MaxClients()-g_Config.m_SvSpectatorSlots-g_Config.m_SvReservedSlots); p.AddString(aBuf, 3); // max players
|
||||
str_format(aBuf, sizeof(aBuf), "%d", ClientCount); p.AddString(aBuf, 3); // num clients
|
||||
str_format(aBuf, sizeof(aBuf), "%d", ClientCount); p.AddString(aBuf, 3); // num clients
|
||||
str_format(aBuf, sizeof(aBuf), "%d", m_NetServer.MaxClients()); p.AddString(aBuf, 3); // max clients
|
||||
|
||||
for(i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
if(m_aClients[i].m_State != CClient::STATE_EMPTY)
|
||||
{
|
||||
p.AddString(ClientName(i), MAX_NAME_LENGTH); // client name
|
||||
p.AddString(ClientClan(i), MAX_CLAN_LENGTH); // client clan
|
||||
str_format(aBuf, sizeof(aBuf), "%d", m_aClients[i].m_Country); p.AddString(aBuf, 6); // client country
|
||||
str_format(aBuf, sizeof(aBuf), "%d", m_aClients[i].m_Score); p.AddString(aBuf, 6); // client score
|
||||
str_format(aBuf, sizeof(aBuf), "%d", GameServer()->IsClientPlayer(i)?1:0); p.AddString(aBuf, 2); // is player?
|
||||
p.AddString(ClientName(i), MAX_NAME_LENGTH); // client name
|
||||
p.AddString(ClientClan(i), MAX_CLAN_LENGTH); // client clan
|
||||
str_format(aBuf, sizeof(aBuf), "%d", m_aClients[i].m_Country); p.AddString(aBuf, 6); // client country
|
||||
str_format(aBuf, sizeof(aBuf), "%d", m_aClients[i].m_Score); p.AddString(aBuf, 6); // client score
|
||||
str_format(aBuf, sizeof(aBuf), "%d", GameServer()->IsClientPlayer(i)?1:0); p.AddString(aBuf, 2); // is player?
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1375,7 +1375,7 @@ void CServer::ConBan(IConsole::IResult *pResult, void *pUser, int ClientID)
|
|||
CServer *pServer = (CServer *)pUser;
|
||||
const char *pStr = pResult->GetString(0);
|
||||
int Minutes = 30;
|
||||
const char *pReason = "No reason given";
|
||||
const char *pReason = "No reason given";
|
||||
|
||||
if(pResult->NumArguments() > 1)
|
||||
Minutes = pResult->GetInteger(1);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "compression.h"
|
||||
|
||||
// Format: ESDDDDDD EDDDDDDD EDD... Extended, Data, Sign
|
||||
// Format: ESDDDDDD EDDDDDDD EDD... Extended, Data, Sign
|
||||
unsigned char *CVariableInt::Pack(unsigned char *pDst, int i)
|
||||
{
|
||||
*pDst = (i>>25)&0x40; // set sign bit if i<0
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#ifndef ENGINE_SHARED_E_CONFIG_H
|
||||
#define ENGINE_SHARED_E_CONFIG_H
|
||||
#ifndef ENGINE_SHARED_CONFIG_H
|
||||
#define ENGINE_SHARED_CONFIG_H
|
||||
|
||||
struct CConfiguration
|
||||
{
|
||||
#define MACRO_CONFIG_INT(Name,ScriptName,Def,Min,Max,Save,Desc,Level) int m_##Name;
|
||||
#define MACRO_CONFIG_STR(Name,ScriptName,Len,Def,Save,Desc,Level) char m_##Name[Len]; // Flawfinder: ignore
|
||||
#include "config_variables.h"
|
||||
#undef MACRO_CONFIG_INT
|
||||
#undef MACRO_CONFIG_STR
|
||||
#define MACRO_CONFIG_INT(Name,ScriptName,Def,Min,Max,Save,Desc,Level) int m_##Name;
|
||||
#define MACRO_CONFIG_STR(Name,ScriptName,Len,Def,Save,Desc,Level) char m_##Name[Len]; // Flawfinder: ignore
|
||||
#include "config_variables.h"
|
||||
#undef MACRO_CONFIG_INT
|
||||
#undef MACRO_CONFIG_STR
|
||||
};
|
||||
|
||||
extern CConfiguration g_Config;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#ifndef ENGINE_SHARED_E_CONFIG_VARIABLES_H
|
||||
#define ENGINE_SHARED_E_CONFIG_VARIABLES_H
|
||||
#undef ENGINE_SHARED_E_CONFIG_VARIABLES_H // this file will be included several times
|
||||
#ifndef ENGINE_SHARED_CONFIG_VARIABLES_H
|
||||
#define ENGINE_SHARED_CONFIG_VARIABLES_H
|
||||
#undef ENGINE_SHARED_CONFIG_VARIABLES_H // this file will be included several times
|
||||
|
||||
// TODO: remove this
|
||||
#include "././game/variables.h"
|
||||
|
@ -47,6 +47,7 @@ MACRO_CONFIG_INT(BrMaxRequests, br_max_requests, 25, 0, 1000, CFGFLAG_SAVE|CFGFL
|
|||
MACRO_CONFIG_INT(SndBufferSize, snd_buffer_size, 512, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound buffer size", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(SndRate, snd_rate, 48000, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound mixing rate", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(SndEnable, snd_enable, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound enable", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(SndMusic, snd_enable_music, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Play background music", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(SndVolume, snd_volume, 100, 0, 100, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound volume", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(SndDevice, snd_device, -1, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "(deprecated) Sound device to use", IConsole::CONSOLELEVEL_USER)
|
||||
|
||||
|
@ -55,7 +56,7 @@ MACRO_CONFIG_INT(SndNonactiveMute, snd_nonactive_mute, 0, 0, 1, CFGFLAG_SAVE|CFG
|
|||
MACRO_CONFIG_INT(GfxScreenWidth, gfx_screen_width, 800, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen resolution width", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(GfxScreenHeight, gfx_screen_height, 600, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen resolution height", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(GfxFullscreen, gfx_fullscreen, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Fullscreen", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(GfxAlphabits, gfx_alphabits, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Alpha bits for framebuffer (fullscreen only)", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(GfxAlphabits, gfx_alphabits, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Alpha bits for framebuffer (fullscreen only)", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(GfxColorDepth, gfx_color_depth, 24, 16, 24, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Colors bits for framebuffer (fullscreen only)", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(GfxClear, gfx_clear, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Clear screen before rendering", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(GfxVsync, gfx_vsync, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Vertical sync", IConsole::CONSOLELEVEL_USER)
|
||||
|
|
|
@ -225,12 +225,12 @@ bool CConsole::LineIsValid(const char *pStr)
|
|||
}
|
||||
else if(!InString)
|
||||
{
|
||||
if(*pEnd == ';') // command separator
|
||||
if(*pEnd == ';') // command separator
|
||||
{
|
||||
pNextPart = pEnd+1;
|
||||
break;
|
||||
}
|
||||
else if(*pEnd == '#') // comment, no need to do anything more
|
||||
else if(*pEnd == '#') // comment, no need to do anything more
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -281,12 +281,12 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID, in
|
|||
}
|
||||
else if(!InString)
|
||||
{
|
||||
if(*pEnd == ';') // command separator
|
||||
if(*pEnd == ';') // command separator
|
||||
{
|
||||
pNextPart = pEnd+1;
|
||||
break;
|
||||
}
|
||||
else if(*pEnd == '#') // comment, no need to do anything more
|
||||
else if(*pEnd == '#') // comment, no need to do anything more
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -671,7 +671,6 @@ void CConsole::Register(const char *pName, const char *pParams,
|
|||
pCommand->m_Flags = Flags;
|
||||
pCommand->m_Level = Level;
|
||||
|
||||
|
||||
pCommand->m_pNext = m_pFirstCommand;
|
||||
m_pFirstCommand = pCommand;
|
||||
m_aCommandCount[pCommand->m_Level]++;
|
||||
|
|
|
@ -56,7 +56,7 @@ class CConsole : public IConsole
|
|||
|
||||
enum
|
||||
{
|
||||
CONSOLE_MAX_STR_LENGTH = 1024,
|
||||
CONSOLE_MAX_STR_LENGTH = 1024,
|
||||
MAX_PARTS = (CONSOLE_MAX_STR_LENGTH+1)/2
|
||||
};
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ int CDataFileReader::GetDataSize(int Index)
|
|||
|
||||
if(Index == m_pDataFile->m_Header.m_NumRawData-1)
|
||||
return m_pDataFile->m_Header.m_DataSize-m_pDataFile->m_Info.m_pDataOffsets[Index];
|
||||
return m_pDataFile->m_Info.m_pDataOffsets[Index+1]-m_pDataFile->m_Info.m_pDataOffsets[Index];
|
||||
return m_pDataFile->m_Info.m_pDataOffsets[Index+1]-m_pDataFile->m_Info.m_pDataOffsets[Index];
|
||||
}
|
||||
|
||||
void *CDataFileReader::GetDataImpl(int Index, int Swap)
|
||||
|
@ -340,7 +340,7 @@ int CDataFileReader::GetItemSize(int Index)
|
|||
if(!m_pDataFile) { return 0; }
|
||||
if(Index == m_pDataFile->m_Header.m_NumItems-1)
|
||||
return m_pDataFile->m_Header.m_ItemSize-m_pDataFile->m_Info.m_pItemOffsets[Index];
|
||||
return m_pDataFile->m_Info.m_pItemOffsets[Index+1]-m_pDataFile->m_Info.m_pItemOffsets[Index];
|
||||
return m_pDataFile->m_Info.m_pItemOffsets[Index+1]-m_pDataFile->m_Info.m_pItemOffsets[Index];
|
||||
}
|
||||
|
||||
void *CDataFileReader::GetItem(int Index, int *pType, int *pID)
|
||||
|
|
|
@ -47,7 +47,7 @@ int CDemoRecorder::Start(class IStorage *pStorage, class IConsole *pConsole, con
|
|||
char aBuf[512];
|
||||
str_format(aMapFilename, sizeof(aMapFilename), "%s.map", pMap);
|
||||
if(pStorage->FindFile(aMapFilename, "maps", IStorage::TYPE_ALL, aBuf, sizeof(aBuf)))
|
||||
MapFile = pStorage->OpenFile(aBuf, IOFLAG_READ, IStorage::TYPE_ALL);
|
||||
MapFile = pStorage->OpenFile(aBuf, IOFLAG_READ, IStorage::TYPE_ALL);
|
||||
}
|
||||
if(!MapFile)
|
||||
{
|
||||
|
@ -113,14 +113,14 @@ int CDemoRecorder::Start(class IStorage *pStorage, class IConsole *pConsole, con
|
|||
|
||||
/*
|
||||
Tickmarker
|
||||
7 = Always set
|
||||
6 = Keyframe flag
|
||||
0-5 = Delta tick
|
||||
7 = Always set
|
||||
6 = Keyframe flag
|
||||
0-5 = Delta tick
|
||||
|
||||
Normal
|
||||
7 = Not set
|
||||
5-6 = Type
|
||||
0-4 = Size
|
||||
7 = Not set
|
||||
5-6 = Type
|
||||
0-4 = Size
|
||||
*/
|
||||
|
||||
enum
|
||||
|
|
|
@ -12,20 +12,20 @@ CSnapshotItem *CSnapshot::GetItem(int Index)
|
|||
|
||||
int CSnapshot::GetItemSize(int Index)
|
||||
{
|
||||
if(Index == m_NumItems-1)
|
||||
return (m_DataSize - Offsets()[Index]) - sizeof(CSnapshotItem);
|
||||
return (Offsets()[Index+1] - Offsets()[Index]) - sizeof(CSnapshotItem);
|
||||
if(Index == m_NumItems-1)
|
||||
return (m_DataSize - Offsets()[Index]) - sizeof(CSnapshotItem);
|
||||
return (Offsets()[Index+1] - Offsets()[Index]) - sizeof(CSnapshotItem);
|
||||
}
|
||||
|
||||
int CSnapshot::GetItemIndex(int Key)
|
||||
{
|
||||
// TODO: OPT: this should not be a linear search. very bad
|
||||
for(int i = 0; i < m_NumItems; i++)
|
||||
{
|
||||
if(GetItem(i)->Key() == Key)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
// TODO: OPT: this should not be a linear search. very bad
|
||||
for(int i = 0; i < m_NumItems; i++)
|
||||
{
|
||||
if(GetItem(i)->Key() == Key)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int CSnapshot::Crc()
|
||||
|
@ -128,7 +128,7 @@ void CSnapshotDelta::UndiffItem(int *pPast, int *pDiff, int *pOut, int Size)
|
|||
else
|
||||
{
|
||||
unsigned char aBuf[16];
|
||||
unsigned char *pEnd = CVariableInt::Pack(aBuf, *pDiff);
|
||||
unsigned char *pEnd = CVariableInt::Pack(aBuf, *pDiff);
|
||||
m_aSnapshotDataRate[m_SnapshotCurrent] += (int)(pEnd - (unsigned char*)aBuf) * 8;
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ int CSnapshotDelta::CreateDelta(CSnapshot *pFrom, CSnapshot *pTo, void *pDstData
|
|||
// we do this as a separate pass because it helps the cache
|
||||
for(i = 0; i < pTo->NumItems(); i++)
|
||||
{
|
||||
pCurItem = pTo->GetItem(i); // O(1) .. O(n)
|
||||
pCurItem = pTo->GetItem(i); // O(1) .. O(n)
|
||||
aPastIndecies[i] = GetItemIndexHashed(pCurItem->Key(), Hashlist); // O(n) .. O(n^n)
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,7 @@ int CSnapshotDelta::CreateDelta(CSnapshot *pFrom, CSnapshot *pTo, void *pDstData
|
|||
{
|
||||
// do delta
|
||||
ItemSize = pTo->GetItemSize(i); // O(1) .. O(n)
|
||||
pCurItem = pTo->GetItem(i); // O(1) .. O(n)
|
||||
pCurItem = pTo->GetItem(i); // O(1) .. O(n)
|
||||
PastIndex = aPastIndecies[i];
|
||||
|
||||
if(PastIndex != -1)
|
||||
|
@ -411,8 +411,8 @@ void CSnapshotStorage::PurgeUntil(int Tick)
|
|||
mem_free(pHolder);
|
||||
|
||||
// did we come to the end of the list?
|
||||
if (!pNext)
|
||||
break;
|
||||
if (!pNext)
|
||||
break;
|
||||
|
||||
m_pFirst = pNext;
|
||||
pNext->m_pPrev = 0x0;
|
||||
|
|
|
@ -21,9 +21,9 @@ public:
|
|||
virtual void SetChannel(int ChannelID, float Volume, float Panning) = 0;
|
||||
virtual void SetListenerPos(float x, float y) = 0;
|
||||
|
||||
virtual int PlayAt(int ChannelID, int SoundID, int Flags, float x, float y) = 0;
|
||||
virtual int Play(int ChannelID, int SoundID, int Flags) = 0;
|
||||
virtual void Stop(int VoiceID) = 0;
|
||||
virtual int PlayAt(int ChannelID, int SampleID, int Flags, float x, float y) = 0;
|
||||
virtual int Play(int ChannelID, int SampleID, int Flags) = 0;
|
||||
virtual void Stop(int SampleID) = 0;
|
||||
virtual void StopAll() = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -100,6 +100,8 @@ void CBinds::SetDefaults()
|
|||
Bind(KEY_MOUSE_2, "+hook");
|
||||
Bind(KEY_LSHIFT, "+emote");
|
||||
Bind(KEY_RSHIFT, "+spectate");
|
||||
Bind(KEY_RIGHT, "spectate_next");
|
||||
Bind(KEY_LEFT, "spectate_previous");
|
||||
|
||||
Bind('1', "+weapon1");
|
||||
Bind('2', "+weapon2");
|
||||
|
|
|
@ -235,9 +235,9 @@ float CGameConsole::TimeNow()
|
|||
|
||||
CGameConsole::CInstance *CGameConsole::CurrentConsole()
|
||||
{
|
||||
if(m_ConsoleType == CONSOLETYPE_REMOTE)
|
||||
return &m_RemoteConsole;
|
||||
return &m_LocalConsole;
|
||||
if(m_ConsoleType == CONSOLETYPE_REMOTE)
|
||||
return &m_RemoteConsole;
|
||||
return &m_LocalConsole;
|
||||
}
|
||||
|
||||
void CGameConsole::OnReset()
|
||||
|
@ -310,7 +310,7 @@ void CGameConsole::PossibleCommandsRenderCallback(const char *pStr, void *pUser)
|
|||
|
||||
void CGameConsole::OnRender()
|
||||
{
|
||||
CUIRect Screen = *UI()->Screen();
|
||||
CUIRect Screen = *UI()->Screen();
|
||||
float ConsoleMaxHeight = Screen.h*3/5.0f;
|
||||
float ConsoleHeight;
|
||||
|
||||
|
@ -350,31 +350,31 @@ void CGameConsole::OnRender()
|
|||
|
||||
// do console shadow
|
||||
Graphics()->TextureSet(-1);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->QuadsBegin();
|
||||
IGraphics::CColorVertex Array[4] = {
|
||||
IGraphics::CColorVertex(0, 0,0,0, 0.5f),
|
||||
IGraphics::CColorVertex(1, 0,0,0, 0.5f),
|
||||
IGraphics::CColorVertex(2, 0,0,0, 0.0f),
|
||||
IGraphics::CColorVertex(0, 0,0,0, 0.5f),
|
||||
IGraphics::CColorVertex(1, 0,0,0, 0.5f),
|
||||
IGraphics::CColorVertex(2, 0,0,0, 0.0f),
|
||||
IGraphics::CColorVertex(3, 0,0,0, 0.0f)};
|
||||
Graphics()->SetColorVertex(Array, 4);
|
||||
IGraphics::CQuadItem QuadItem(0, ConsoleHeight, Screen.w, 10.0f);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
Graphics()->QuadsEnd();
|
||||
|
||||
// do background
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_CONSOLE_BG].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(0.2f, 0.2f, 0.2f,0.9f);
|
||||
if(m_ConsoleType == CONSOLETYPE_REMOTE)
|
||||
Graphics()->SetColor(0.4f, 0.2f, 0.2f,0.9f);
|
||||
Graphics()->QuadsSetSubset(0,-ConsoleHeight*0.075f,Screen.w*0.075f*0.5f,0);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(0.2f, 0.2f, 0.2f,0.9f);
|
||||
if(m_ConsoleType == CONSOLETYPE_REMOTE)
|
||||
Graphics()->SetColor(0.4f, 0.2f, 0.2f,0.9f);
|
||||
Graphics()->QuadsSetSubset(0,-ConsoleHeight*0.075f,Screen.w*0.075f*0.5f,0);
|
||||
QuadItem = IGraphics::CQuadItem(0, 0, Screen.w, ConsoleHeight);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
Graphics()->QuadsEnd();
|
||||
|
||||
// do small bar shadow
|
||||
Graphics()->TextureSet(-1);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->QuadsBegin();
|
||||
Array[0] = IGraphics::CColorVertex(0, 0,0,0, 0.0f);
|
||||
Array[1] = IGraphics::CColorVertex(1, 0,0,0, 0.0f);
|
||||
Array[2] = IGraphics::CColorVertex(2, 0,0,0, 0.25f);
|
||||
|
@ -382,20 +382,20 @@ void CGameConsole::OnRender()
|
|||
Graphics()->SetColorVertex(Array, 4);
|
||||
QuadItem = IGraphics::CQuadItem(0, ConsoleHeight-20, Screen.w, 10);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
Graphics()->QuadsEnd();
|
||||
|
||||
// do the lower bar
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_CONSOLE_BAR].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.9f);
|
||||
Graphics()->QuadsSetSubset(0,0.1f,Screen.w*0.015f,1-0.1f);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.9f);
|
||||
Graphics()->QuadsSetSubset(0,0.1f,Screen.w*0.015f,1-0.1f);
|
||||
QuadItem = IGraphics::CQuadItem(0,ConsoleHeight-10.0f,Screen.w,10.0f);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
Graphics()->QuadsEnd();
|
||||
|
||||
ConsoleHeight -= 22.0f;
|
||||
ConsoleHeight -= 22.0f;
|
||||
|
||||
CInstance *pConsole = CurrentConsole();
|
||||
CInstance *pConsole = CurrentConsole();
|
||||
|
||||
{
|
||||
float FontSize = 10.0f;
|
||||
|
|
|
@ -88,24 +88,24 @@ void CControls::OnConsoleInit()
|
|||
Console()->Register("+hook", "", CFGFLAG_CLIENT, ConKeyInputState, &m_InputData.m_Hook, "Hook", IConsole::CONSOLELEVEL_USER);
|
||||
Console()->Register("+fire", "", CFGFLAG_CLIENT, ConKeyInputCounter, &m_InputData.m_Fire, "Fire", IConsole::CONSOLELEVEL_USER);
|
||||
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 1}; Console()->Register("+weapon1", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to hammer", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 2}; Console()->Register("+weapon2", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to gun", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 3}; Console()->Register("+weapon3", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to shotgun", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 4}; Console()->Register("+weapon4", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to grenade", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 5}; Console()->Register("+weapon5", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to rifle", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 1}; Console()->Register("+weapon1", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to hammer", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 2}; Console()->Register("+weapon2", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to gun", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 3}; Console()->Register("+weapon3", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to shotgun", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 4}; Console()->Register("+weapon4", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to grenade", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_WantedWeapon, 5}; Console()->Register("+weapon5", "", CFGFLAG_CLIENT, ConKeyInputSet, (void *)&s_Set, "Switch to rifle", IConsole::CONSOLELEVEL_USER); }
|
||||
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_NextWeapon, 0}; Console()->Register("+nextweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to next weapon", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_PrevWeapon, 0}; Console()->Register("+prevweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to previous weapon", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_NextWeapon, 0}; Console()->Register("+nextweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to next weapon", IConsole::CONSOLELEVEL_USER); }
|
||||
{ static CInputSet s_Set = {this, &m_InputData.m_PrevWeapon, 0}; Console()->Register("+prevweapon", "", CFGFLAG_CLIENT, ConKeyInputNextPrevWeapon, (void *)&s_Set, "Switch to previous weapon", IConsole::CONSOLELEVEL_USER); }
|
||||
}
|
||||
|
||||
void CControls::OnMessage(int Msg, void *pRawMsg)
|
||||
{
|
||||
if(Msg == NETMSGTYPE_SV_WEAPONPICKUP)
|
||||
{
|
||||
CNetMsg_Sv_WeaponPickup *pMsg = (CNetMsg_Sv_WeaponPickup *)pRawMsg;
|
||||
if(g_Config.m_ClAutoswitchWeapons)
|
||||
m_InputData.m_WantedWeapon = pMsg->m_Weapon+1;
|
||||
}
|
||||
if(Msg == NETMSGTYPE_SV_WEAPONPICKUP)
|
||||
{
|
||||
CNetMsg_Sv_WeaponPickup *pMsg = (CNetMsg_Sv_WeaponPickup *)pRawMsg;
|
||||
if(g_Config.m_ClAutoswitchWeapons)
|
||||
m_InputData.m_WantedWeapon = pMsg->m_Weapon+1;
|
||||
}
|
||||
}
|
||||
|
||||
int CControls::SnapInput(int *pData)
|
||||
|
|
|
@ -22,7 +22,7 @@ void CDebugHud::RenderNetCorrections()
|
|||
if(!g_Config.m_Debug || g_Config.m_DbgGraphs || !m_pClient->m_Snap.m_pLocalCharacter || !m_pClient->m_Snap.m_pLocalPrevCharacter)
|
||||
return;
|
||||
|
||||
float Width = 300*Graphics()->ScreenAspect();
|
||||
float Width = 300*Graphics()->ScreenAspect();
|
||||
Graphics()->MapScreen(0, 0, Width, 300);
|
||||
|
||||
/*float speed = distance(vec2(netobjects.local_prev_character->x, netobjects.local_prev_character->y),
|
||||
|
@ -31,7 +31,7 @@ void CDebugHud::RenderNetCorrections()
|
|||
float Velspeed = length(vec2(m_pClient->m_Snap.m_pLocalCharacter->m_VelX/256.0f, m_pClient->m_Snap.m_pLocalCharacter->m_VelY/256.0f))*50;
|
||||
float Ramp = VelocityRamp(Velspeed, m_pClient->m_Tuning.m_VelrampStart, m_pClient->m_Tuning.m_VelrampRange, m_pClient->m_Tuning.m_VelrampCurvature);
|
||||
|
||||
const char *paStrings[] = {"velspeed:", "velspeed*ramp:", "ramp:", "Pos", " x:", " y:", "netobj corrections", " num:", " on:"};
|
||||
const char *paStrings[] = {"velspeed:", "velspeed*ramp:", "ramp:", "Pos", " x:", " y:", "netobj corrections", " num:", " on:"};
|
||||
const int Num = sizeof(paStrings)/sizeof(char *);
|
||||
const float LineHeight = 6.0f;
|
||||
const float Fontsize = 5.0f;
|
||||
|
|
|
@ -113,7 +113,7 @@ void CEmoticon::OnRender()
|
|||
if (length(m_SelectorMouse) > 100)
|
||||
m_SelectedEmote = (int)(SelectedAngle / (2*pi) * NUM_EMOTICONS);
|
||||
|
||||
CUIRect Screen = *UI()->Screen();
|
||||
CUIRect Screen = *UI()->Screen();
|
||||
|
||||
Graphics()->MapScreen(Screen.x, Screen.y, Screen.w, Screen.h);
|
||||
|
||||
|
@ -147,12 +147,12 @@ void CEmoticon::OnRender()
|
|||
|
||||
Graphics()->QuadsEnd();
|
||||
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_CURSOR].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(1,1,1,1);
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_CURSOR].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(1,1,1,1);
|
||||
IGraphics::CQuadItem QuadItem(m_SelectorMouse.x+Screen.w/2,m_SelectorMouse.y+Screen.h/2,24,24);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
Graphics()->QuadsEnd();
|
||||
}
|
||||
|
||||
void CEmoticon::Emote(int Emoticon)
|
||||
|
|
|
@ -50,7 +50,7 @@ void CHud::RenderGameTimer()
|
|||
Time = m_pClient->m_Snap.m_pGameInfoObj->m_TimeLimit*60 - ((Client()->GameTick()-m_pClient->m_Snap.m_pGameInfoObj->m_RoundStartTick)/Client()->GameTickSpeed());
|
||||
|
||||
if(m_pClient->m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER)
|
||||
Time = 0;
|
||||
Time = 0;
|
||||
}
|
||||
else
|
||||
Time = (Client()->GameTick()-m_pClient->m_Snap.m_pGameInfoObj->m_RoundStartTick)/Client()->GameTickSpeed();
|
||||
|
|
|
@ -204,7 +204,7 @@ void CItems::RenderLaser(const struct CNetObj_Laser *pCurrent)
|
|||
|
||||
float Ticks = Client()->GameTick() + Client()->IntraGameTick() - pCurrent->m_StartTick;
|
||||
float Ms = (Ticks/50.0f) * 1000.0f;
|
||||
float a = Ms / m_pClient->m_Tuning.m_LaserBounceDelay;
|
||||
float a = Ms / m_pClient->m_Tuning.m_LaserBounceDelay;
|
||||
a = clamp(a, 0.0f, 1.0f);
|
||||
float Ia = 1-a;
|
||||
|
||||
|
@ -302,7 +302,7 @@ void CItems::OnRender()
|
|||
const void *pPrev = Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_ID);
|
||||
if (pPrev)
|
||||
{
|
||||
const void *pPrevGameData = Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_GAMEDATA, m_pClient->m_Snap.m_GameDataSnapID);
|
||||
const void *pPrevGameData = Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_GAMEDATA, m_pClient->m_Snap.m_GameDataSnapID);
|
||||
RenderFlag(static_cast<const CNetObj_Flag *>(pPrev), static_cast<const CNetObj_Flag *>(pData),
|
||||
static_cast<const CNetObj_GameData *>(pPrevGameData), m_pClient->m_Snap.m_pGameDataObj);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <engine/config.h>
|
||||
#include <engine/editor.h>
|
||||
#include <engine/engine.h>
|
||||
#include <engine/friends.h>
|
||||
#include <engine/graphics.h>
|
||||
#include <engine/keys.h>
|
||||
|
@ -20,6 +21,7 @@
|
|||
#include <game/generated/protocol.h>
|
||||
|
||||
#include <game/generated/client_data.h>
|
||||
#include <game/client/components/sounds.h>
|
||||
#include <game/client/gameclient.h>
|
||||
#include <game/client/lineinput.h>
|
||||
#include <game/localization.h>
|
||||
|
@ -186,7 +188,7 @@ int CMenus::DoButton_CheckBox_Number(const void *pID, const char *pText, int Che
|
|||
|
||||
int CMenus::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrSize, float FontSize, float *Offset, bool Hidden, int Corners)
|
||||
{
|
||||
int Inside = UI()->MouseInside(pRect);
|
||||
int Inside = UI()->MouseInside(pRect);
|
||||
bool ReturnValue = false;
|
||||
bool UpdateOffset = false;
|
||||
static int s_AtIndex = 0;
|
||||
|
@ -341,8 +343,8 @@ float CMenus::DoScrollbarV(const void *pID, const CUIRect *pRect, float Current)
|
|||
Handle.y += (pRect->h-Handle.h)*Current;
|
||||
|
||||
// logic
|
||||
float ReturnValue = Current;
|
||||
int Inside = UI()->MouseInside(&Handle);
|
||||
float ReturnValue = Current;
|
||||
int Inside = UI()->MouseInside(&Handle);
|
||||
|
||||
if(UI()->ActiveItem() == pID)
|
||||
{
|
||||
|
@ -383,7 +385,7 @@ float CMenus::DoScrollbarV(const void *pID, const CUIRect *pRect, float Current)
|
|||
Slider.Margin(5.0f, &Slider);
|
||||
RenderTools()->DrawUIRect(&Slider, vec4(1,1,1,0.25f)*ButtonColorMul(pID), CUI::CORNER_ALL, 2.5f);
|
||||
|
||||
return ReturnValue;
|
||||
return ReturnValue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -397,8 +399,8 @@ float CMenus::DoScrollbarH(const void *pID, const CUIRect *pRect, float Current)
|
|||
Handle.x += (pRect->w-Handle.w)*Current;
|
||||
|
||||
// logic
|
||||
float ReturnValue = Current;
|
||||
int Inside = UI()->MouseInside(&Handle);
|
||||
float ReturnValue = Current;
|
||||
int Inside = UI()->MouseInside(&Handle);
|
||||
|
||||
if(UI()->ActiveItem() == pID)
|
||||
{
|
||||
|
@ -439,7 +441,7 @@ float CMenus::DoScrollbarH(const void *pID, const CUIRect *pRect, float Current)
|
|||
Slider.Margin(5.0f, &Slider);
|
||||
RenderTools()->DrawUIRect(&Slider, vec4(1,1,1,0.25f)*ButtonColorMul(pID), CUI::CORNER_ALL, 2.5f);
|
||||
|
||||
return ReturnValue;
|
||||
return ReturnValue;
|
||||
}
|
||||
|
||||
int CMenus::DoKeyReader(void *pID, const CUIRect *pRect, int Key)
|
||||
|
@ -557,7 +559,7 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
if(DoButton_MenuTab(&s_FavoritesButton, Localize("Favorites"), m_ActivePage==PAGE_FAVORITES, &Button, CUI::CORNER_TR))
|
||||
{
|
||||
ServerBrowser()->Refresh(IServerBrowser::TYPE_FAVORITES);
|
||||
NewPage = PAGE_FAVORITES;
|
||||
NewPage = PAGE_FAVORITES;
|
||||
}
|
||||
|
||||
Box.VSplitLeft(4.0f*5, 0, &Box);
|
||||
|
@ -566,7 +568,7 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
if(DoButton_MenuTab(&s_DemosButton, Localize("Demos"), m_ActivePage==PAGE_DEMOS, &Button, CUI::CORNER_T))
|
||||
{
|
||||
DemolistPopulate();
|
||||
NewPage = PAGE_DEMOS;
|
||||
NewPage = PAGE_DEMOS;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -646,7 +648,7 @@ void CMenus::RenderLoading()
|
|||
vec3 Rgb = HslToRgb(vec3(g_Config.m_UiColorHue/255.0f, g_Config.m_UiColorSat/255.0f, g_Config.m_UiColorLht/255.0f));
|
||||
ms_GuiColor = vec4(Rgb.r, Rgb.g, Rgb.b, g_Config.m_UiColorAlpha/255.0f);
|
||||
|
||||
CUIRect Screen = *UI()->Screen();
|
||||
CUIRect Screen = *UI()->Screen();
|
||||
Graphics()->MapScreen(Screen.x, Screen.y, Screen.w, Screen.h);
|
||||
|
||||
RenderBackground();
|
||||
|
@ -765,7 +767,7 @@ void CMenus::PopupMessage(const char *pTopic, const char *pBody, const char *pBu
|
|||
|
||||
int CMenus::Render()
|
||||
{
|
||||
CUIRect Screen = *UI()->Screen();
|
||||
CUIRect Screen = *UI()->Screen();
|
||||
Graphics()->MapScreen(Screen.x, Screen.y, Screen.w, Screen.h);
|
||||
|
||||
static bool s_First = true;
|
||||
|
@ -777,6 +779,7 @@ int CMenus::Render()
|
|||
ServerBrowser()->Refresh(IServerBrowser::TYPE_LAN);
|
||||
else if(g_Config.m_UiPage == PAGE_FAVORITES)
|
||||
ServerBrowser()->Refresh(IServerBrowser::TYPE_FAVORITES);
|
||||
m_pClient->m_pSounds->Enqueue(CSounds::CHN_MUSIC, SOUND_MENU);
|
||||
s_First = false;
|
||||
}
|
||||
|
||||
|
@ -873,7 +876,7 @@ int CMenus::Render()
|
|||
else if(m_Popup == POPUP_CONNECTING)
|
||||
{
|
||||
pTitle = Localize("Connecting to");
|
||||
pExtraText = g_Config.m_UiServerAddress; // TODO: query the client about the address
|
||||
pExtraText = g_Config.m_UiServerAddress; // TODO: query the client about the address
|
||||
pButtonText = Localize("Abort");
|
||||
if(Client()->MapDownloadTotalsize() > 0)
|
||||
{
|
||||
|
@ -1346,6 +1349,7 @@ void CMenus::OnStateChange(int NewState, int OldState)
|
|||
|
||||
if(NewState == IClient::STATE_OFFLINE)
|
||||
{
|
||||
m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f, vec2(0, 0));
|
||||
m_Popup = POPUP_NONE;
|
||||
if(Client()->ErrorString() && Client()->ErrorString()[0] != 0)
|
||||
{
|
||||
|
@ -1544,7 +1548,7 @@ void CMenus::RenderBackground()
|
|||
Graphics()->QuadsEnd();
|
||||
|
||||
// restore screen
|
||||
{CUIRect Screen = *UI()->Screen();
|
||||
{CUIRect Screen = *UI()->Screen();
|
||||
Graphics()->MapScreen(Screen.x, Screen.y, Screen.w, Screen.h);}
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class CMenus : public CComponent
|
|||
};
|
||||
|
||||
void UiDoListboxStart(const void *pID, const CUIRect *pRect, float RowHeight, const char *pTitle, const char *pBottomText, int NumItems,
|
||||
int ItemsPerRow, int SelectedIndex, float ScrollValue);
|
||||
int ItemsPerRow, int SelectedIndex, float ScrollValue);
|
||||
CListboxItem UiDoListboxNextItem(const void *pID, bool Selected = false);
|
||||
CListboxItem UiDoListboxNextRow();
|
||||
int UiDoListboxEnd(float *pScrollValue, bool *pItemActivated);
|
||||
|
|
|
@ -162,7 +162,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
else
|
||||
ScrollNum = 0;
|
||||
|
||||
if(m_SelectedIndex > -1)
|
||||
if(m_SelectedIndex > -1)
|
||||
{
|
||||
for(int i = 0; i < m_NumInputEvents; i++)
|
||||
{
|
||||
|
@ -174,10 +174,10 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
}
|
||||
if(NewIndex > -1 && NewIndex < NumServers)
|
||||
{
|
||||
//scroll
|
||||
float IndexY = View.y - s_ScrollValue*ScrollNum*s_aCols[0].m_Rect.h + NewIndex*s_aCols[0].m_Rect.h;
|
||||
//scroll
|
||||
float IndexY = View.y - s_ScrollValue*ScrollNum*s_aCols[0].m_Rect.h + NewIndex*s_aCols[0].m_Rect.h;
|
||||
int Scroll = View.y > IndexY ? -1 : View.y+View.h < IndexY+s_aCols[0].m_Rect.h ? 1 : 0;
|
||||
if(Scroll)
|
||||
if(Scroll)
|
||||
{
|
||||
if(Scroll < 0)
|
||||
{
|
||||
|
@ -199,8 +199,8 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
}
|
||||
}
|
||||
|
||||
if(s_ScrollValue < 0) s_ScrollValue = 0;
|
||||
if(s_ScrollValue > 1) s_ScrollValue = 1;
|
||||
if(s_ScrollValue < 0) s_ScrollValue = 0;
|
||||
if(s_ScrollValue > 1) s_ScrollValue = 1;
|
||||
|
||||
// set clipping
|
||||
UI()->ClipEnable(&View);
|
||||
|
@ -224,7 +224,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
int ItemIndex = i;
|
||||
const CServerInfo *pItem = ServerBrowser()->SortedGet(ItemIndex);
|
||||
CUIRect Row;
|
||||
CUIRect SelectHitBox;
|
||||
CUIRect SelectHitBox;
|
||||
|
||||
int Selected = str_comp(pItem->m_aAddress, g_Config.m_UiServerAddress) == 0; //selected_index==ItemIndex;
|
||||
|
||||
|
@ -780,14 +780,14 @@ void CMenus::RenderServerbrowserFriends(CUIRect View)
|
|||
void CMenus::RenderServerbrowser(CUIRect MainView)
|
||||
{
|
||||
/*
|
||||
+-----------------+ +------+
|
||||
| | | |
|
||||
| | | tool |
|
||||
| server list | | box |
|
||||
| | | |
|
||||
| | | |
|
||||
+-----------------+ | |
|
||||
status box tab +------+
|
||||
+-----------------+ +-------+
|
||||
| | | |
|
||||
| | | tool |
|
||||
| server list | | box |
|
||||
| | | |
|
||||
| | | |
|
||||
+-----------------+ | |
|
||||
status box tab +-------+
|
||||
*/
|
||||
|
||||
CUIRect ServerList, ToolBox, StatusBox, TabBar;
|
||||
|
|
|
@ -30,7 +30,7 @@ int CMenus::DoButton_DemoPlayer(const void *pID, const char *pText, int Checked,
|
|||
|
||||
int CMenus::DoButton_Sprite(const void *pID, int ImageID, int SpriteID, int Checked, const CUIRect *pRect, int Corners)
|
||||
{
|
||||
RenderTools()->DrawUIRect(pRect, Checked ? vec4(1.0f, 1.0f, 1.0f, 0.10f) : vec4(1.0f, 1.0f, 1.0f, 0.5f)*ButtonColorMul(pID), Corners, 5.0f);
|
||||
RenderTools()->DrawUIRect(pRect, Checked ? vec4(1.0f, 1.0f, 1.0f, 0.10f) : vec4(1.0f, 1.0f, 1.0f, 0.5f)*ButtonColorMul(pID), Corners, 5.0f);
|
||||
Graphics()->TextureSet(g_pData->m_aImages[ImageID].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
if(!Checked)
|
||||
|
@ -102,7 +102,7 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
|
|||
UI()->DoLabel(&SeekBar, aBuffer, SeekBar.h*0.70f, 0);
|
||||
|
||||
// do the logic
|
||||
int Inside = UI()->MouseInside(&SeekBar);
|
||||
int Inside = UI()->MouseInside(&SeekBar);
|
||||
|
||||
if(UI()->ActiveItem() == id)
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <base/math.h>
|
||||
|
||||
|
||||
#include <engine/engine.h>
|
||||
#include <engine/graphics.h>
|
||||
#include <engine/storage.h>
|
||||
#include <engine/textrender.h>
|
||||
|
@ -13,6 +13,7 @@
|
|||
#include <game/generated/protocol.h>
|
||||
#include <game/generated/client_data.h>
|
||||
|
||||
#include <game/client/components/sounds.h>
|
||||
#include <game/client/ui.h>
|
||||
#include <game/client/render.h>
|
||||
#include <game/client/gameclient.h>
|
||||
|
@ -274,7 +275,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
|
|||
RenderTools()->RenderTee(CAnimState::GetIdle(), &OwnSkinInfo, 0, vec2(1, 0), vec2(Label.x+30.0f, Label.y+28.0f));
|
||||
Label.HSplitTop(15.0f, 0, &Label);;
|
||||
Label.VSplitLeft(70.0f, 0, &Label);
|
||||
UI()->DoLabelScaled(&Label, g_Config.m_PlayerSkin, 14.0f, -1, 150.0f);
|
||||
UI()->DoLabelScaled(&Label, g_Config.m_PlayerSkin, 14.0f, -1, 150.0f);
|
||||
|
||||
// custom colour selector
|
||||
MainView.HSplitTop(20.0f, 0, &MainView);
|
||||
|
@ -323,7 +324,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
|
|||
Label.VSplitLeft(100.0f, &Label, &Button);
|
||||
Button.HMargin(2.0f, &Button);
|
||||
|
||||
float k = ((PrevColor>>((2-s)*8))&0xff) / 255.0f;
|
||||
float k = ((PrevColor>>((2-s)*8))&0xff) / 255.0f;
|
||||
k = DoScrollbarH(&s_aColorSlider[i][s], &Button, k);
|
||||
Color <<= 8;
|
||||
Color += clamp((int)(k*255), 0, 255);
|
||||
|
@ -441,16 +442,19 @@ static CKeyInfo gs_aKeys[] =
|
|||
{ "Show chat", "+show_chat", 0 },
|
||||
{ "Emoticon", "+emote", 0 },
|
||||
{ "Spectator mode", "+spectate", 0 },
|
||||
{ "Spectate next", "spectate_next", 0 },
|
||||
{ "Spectate previous", "spectate_previous", 0 },
|
||||
{ "Console", "toggle_local_console", 0 },
|
||||
{ "Remote console", "toggle_remote_console", 0 },
|
||||
{ "Screenshot", "screenshot", 0 },
|
||||
{ "Scoreboard", "+scoreboard", 0 },
|
||||
};
|
||||
|
||||
/* This is for scripts/update_localization.py to work, don't remove!
|
||||
Localize("Move left");Localize("Move right");Localize("Jump");Localize("Fire");Localize("Hook");Localize("Hammer");
|
||||
Localize("Pistol");Localize("Shotgun");Localize("Grenade");Localize("Rifle");Localize("Next weapon");Localize("Prev. weapon");
|
||||
Localize("Vote yes");Localize("Vote no");Localize("Chat");Localize("Team chat");Localize("Show chat");Localize("Emoticon");
|
||||
Localize("Spectator mode");Localize("Console");Localize("Remote console");Localize("Screenshot");Localize("Scoreboard");
|
||||
Localize("Spectator mode");Localize("Spectate next");Localize("Spectate previous");Localize("Console");Localize("Remote console");Localize("Screenshot");Localize("Scoreboard");
|
||||
*/
|
||||
|
||||
const int g_KeyCount = sizeof(gs_aKeys) / sizeof(CKeyInfo);
|
||||
|
@ -506,7 +510,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
|
|||
|
||||
// movement settings
|
||||
{
|
||||
MovementSettings.HSplitTop(MainView.h/2-5.0f, &MovementSettings, &WeaponSettings);
|
||||
MovementSettings.HSplitTop(MainView.h/3+60.0f, &MovementSettings, &WeaponSettings);
|
||||
RenderTools()->DrawUIRect(&MovementSettings, vec4(1,1,1,0.25f), CUI::CORNER_ALL, 10.0f);
|
||||
MovementSettings.Margin(10.0f, &MovementSettings);
|
||||
|
||||
|
@ -532,6 +536,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
|
|||
// weapon settings
|
||||
{
|
||||
WeaponSettings.HSplitTop(10.0f, 0, &WeaponSettings);
|
||||
WeaponSettings.HSplitTop(MainView.h/3+50.0f, &WeaponSettings, &ResetButton);
|
||||
RenderTools()->DrawUIRect(&WeaponSettings, vec4(1,1,1,0.25f), CUI::CORNER_ALL, 10.0f);
|
||||
WeaponSettings.Margin(10.0f, &WeaponSettings);
|
||||
|
||||
|
@ -541,10 +546,21 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
|
|||
UiDoGetButtons(5, 12, WeaponSettings);
|
||||
}
|
||||
|
||||
// defaults
|
||||
{
|
||||
ResetButton.HSplitTop(10.0f, 0, &ResetButton);
|
||||
RenderTools()->DrawUIRect(&ResetButton, vec4(1,1,1,0.25f), CUI::CORNER_ALL, 10.0f);
|
||||
ResetButton.HMargin(10.0f, &ResetButton);
|
||||
ResetButton.VMargin(30.0f, &ResetButton);
|
||||
static int s_DefaultButton = 0;
|
||||
if(DoButton_Menu((void*)&s_DefaultButton, Localize("Reset to defaults"), 0, &ResetButton))
|
||||
m_pClient->m_pBinds->SetDefaults();
|
||||
}
|
||||
|
||||
// voting settings
|
||||
{
|
||||
VotingSettings.VSplitLeft(10.0f, 0, &VotingSettings);
|
||||
VotingSettings.HSplitTop(MainView.h/4-5.0f, &VotingSettings, &ChatSettings);
|
||||
VotingSettings.HSplitTop(MainView.h/3-75.0f, &VotingSettings, &ChatSettings);
|
||||
RenderTools()->DrawUIRect(&VotingSettings, vec4(1,1,1,0.25f), CUI::CORNER_ALL, 10.0f);
|
||||
VotingSettings.Margin(10.0f, &VotingSettings);
|
||||
|
||||
|
@ -557,7 +573,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
|
|||
// chat settings
|
||||
{
|
||||
ChatSettings.HSplitTop(10.0f, 0, &ChatSettings);
|
||||
ChatSettings.HSplitTop(MainView.h/4-10.0f, &ChatSettings, &MiscSettings);
|
||||
ChatSettings.HSplitTop(MainView.h/3-45.0f, &ChatSettings, &MiscSettings);
|
||||
RenderTools()->DrawUIRect(&ChatSettings, vec4(1,1,1,0.25f), CUI::CORNER_ALL, 10.0f);
|
||||
ChatSettings.Margin(10.0f, &ChatSettings);
|
||||
|
||||
|
@ -570,24 +586,15 @@ void CMenus::RenderSettingsControls(CUIRect MainView)
|
|||
// misc settings
|
||||
{
|
||||
MiscSettings.HSplitTop(10.0f, 0, &MiscSettings);
|
||||
MiscSettings.HSplitBottom(50.0f, &MiscSettings, &ResetButton);
|
||||
RenderTools()->DrawUIRect(&MiscSettings, vec4(1,1,1,0.25f), CUI::CORNER_ALL, 10.0f);
|
||||
MiscSettings.Margin(10.0f, &MiscSettings);
|
||||
|
||||
TextRender()->Text(0, MiscSettings.x, MiscSettings.y, 14.0f*UI()->Scale(), Localize("Miscellaneous"), -1);
|
||||
|
||||
MiscSettings.HSplitTop(14.0f+5.0f+10.0f, 0, &MiscSettings);
|
||||
UiDoGetButtons(17, 23, MiscSettings);
|
||||
UiDoGetButtons(17, 25, MiscSettings);
|
||||
}
|
||||
|
||||
// defaults
|
||||
ResetButton.HSplitTop(10.0f, 0, &ResetButton);
|
||||
RenderTools()->DrawUIRect(&ResetButton, vec4(1,1,1,0.25f), CUI::CORNER_ALL, 10.0f);
|
||||
ResetButton.HMargin(10.0f, &ResetButton);
|
||||
ResetButton.VMargin(30.0f, &ResetButton);
|
||||
static int s_DefaultButton = 0;
|
||||
if(DoButton_Menu((void*)&s_DefaultButton, Localize("Reset to defaults"), 0, &ResetButton))
|
||||
m_pClient->m_pBinds->SetDefaults();
|
||||
}
|
||||
|
||||
void CMenus::RenderSettingsGraphics(CUIRect MainView)
|
||||
|
@ -638,7 +645,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
|
|||
CListboxItem Item = UiDoListboxNextItem(&s_aModes[i], OldSelected == i);
|
||||
if(Item.m_Visible)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), " %dx%d %d bit", s_aModes[i].m_Width, s_aModes[i].m_Height, Depth);
|
||||
str_format(aBuf, sizeof(aBuf), " %dx%d %d bit", s_aModes[i].m_Width, s_aModes[i].m_Height, Depth);
|
||||
UI()->DoLabelScaled(&Item.m_Rect, aBuf, 16.0f, -1);
|
||||
}
|
||||
}
|
||||
|
@ -751,12 +758,26 @@ void CMenus::RenderSettingsSound(CUIRect MainView)
|
|||
if(DoButton_CheckBox(&g_Config.m_SndEnable, Localize("Use sounds"), g_Config.m_SndEnable, &Button))
|
||||
{
|
||||
g_Config.m_SndEnable ^= 1;
|
||||
m_NeedRestartSound = s_SndEnable == g_Config.m_SndEnable && (!s_SndEnable || s_SndRate == g_Config.m_SndRate) ? false : true;
|
||||
if(g_Config.m_SndEnable)
|
||||
m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f, vec2(0, 0));
|
||||
else
|
||||
m_pClient->m_pSounds->Stop(SOUND_MENU);
|
||||
m_NeedRestartSound = g_Config.m_SndEnable && (!s_SndEnable || s_SndRate != g_Config.m_SndRate);
|
||||
}
|
||||
|
||||
if(!g_Config.m_SndEnable)
|
||||
return;
|
||||
|
||||
MainView.HSplitTop(20.0f, &Button, &MainView);
|
||||
if(DoButton_CheckBox(&g_Config.m_SndMusic, Localize("Play background music"), g_Config.m_SndMusic, &Button))
|
||||
{
|
||||
g_Config.m_SndMusic ^= 1;
|
||||
if(g_Config.m_SndMusic)
|
||||
m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f, vec2(0, 0));
|
||||
else
|
||||
m_pClient->m_pSounds->Stop(SOUND_MENU);
|
||||
}
|
||||
|
||||
MainView.HSplitTop(20.0f, &Button, &MainView);
|
||||
if(DoButton_CheckBox(&g_Config.m_SndNonactiveMute, Localize("Mute when not active"), g_Config.m_SndNonactiveMute, &Button))
|
||||
g_Config.m_SndNonactiveMute ^= 1;
|
||||
|
@ -770,11 +791,8 @@ void CMenus::RenderSettingsSound(CUIRect MainView)
|
|||
Button.VSplitLeft(190.0f, 0, &Button);
|
||||
static float Offset = 0.0f;
|
||||
DoEditBox(&g_Config.m_SndRate, &Button, aBuf, sizeof(aBuf), 14.0f, &Offset);
|
||||
int Before = g_Config.m_SndRate;
|
||||
g_Config.m_SndRate = max(1, str_toint(aBuf));
|
||||
|
||||
if(g_Config.m_SndRate != Before)
|
||||
m_NeedRestartSound = s_SndEnable == g_Config.m_SndEnable && s_SndRate == g_Config.m_SndRate ? false : true;
|
||||
m_NeedRestartSound = !s_SndEnable || s_SndRate != g_Config.m_SndRate;
|
||||
}
|
||||
|
||||
// volume slider
|
||||
|
@ -845,7 +863,7 @@ void LoadLanguageIndexfile(IStorage *pStorage, IConsole *pConsole, sorted_array<
|
|||
|
||||
void CMenus::RenderLanguageSelection(CUIRect MainView)
|
||||
{
|
||||
static int s_LanguageList = 0;
|
||||
static int s_LanguageList = 0;
|
||||
static int s_SelectedLanguage = 0;
|
||||
static sorted_array<CLanguage> s_Languages;
|
||||
static float s_ScrollValue = 0;
|
||||
|
|
|
@ -424,7 +424,7 @@ void CPlayers::RenderPlayer(
|
|||
{
|
||||
vec2 Dir = vec2(pPlayerChar->m_X,pPlayerChar->m_Y) - vec2(pPrevChar->m_X, pPrevChar->m_Y);
|
||||
Dir = normalize(Dir);
|
||||
float HadOkenAngle = GetAngle(Dir);
|
||||
float HadOkenAngle = GetAngle(Dir);
|
||||
Graphics()->QuadsSetRotation(HadOkenAngle );
|
||||
//float offsety = -data->weapons[iw].muzzleoffsety;
|
||||
RenderTools()->SelectSprite(g_pData->m_Weapons.m_aId[iw].m_aSpriteMuzzles[IteX], 0);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "skins.h"
|
||||
|
||||
int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser)
|
||||
int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser)
|
||||
{
|
||||
CSkins *pSelf = (CSkins *)pUser;
|
||||
int l = str_length(pName);
|
||||
|
|
|
@ -72,8 +72,13 @@ void CSounds::OnReset()
|
|||
void CSounds::OnRender()
|
||||
{
|
||||
// check for sound initialisation
|
||||
if(m_WaitForSoundJob && m_SoundJob.Status() == CJob::STATE_DONE)
|
||||
m_WaitForSoundJob = false;
|
||||
if(m_WaitForSoundJob)
|
||||
{
|
||||
if(m_SoundJob.Status() == CJob::STATE_DONE)
|
||||
m_WaitForSoundJob = false;
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
// set listner pos
|
||||
Sound()->SetListenerPos(m_pClient->m_pCamera->m_Center.x, m_pClient->m_pCamera->m_Center.y);
|
||||
|
@ -81,13 +86,13 @@ void CSounds::OnRender()
|
|||
// play sound from queue
|
||||
if(m_QueuePos > 0)
|
||||
{
|
||||
int64 Now = time_get();
|
||||
int64 Now = time_get();
|
||||
if(m_QueueWaitTime <= Now)
|
||||
{
|
||||
Play(CHN_GLOBAL, m_aQueue[0], 1.0f, vec2(0,0));
|
||||
Play(m_aQueue[0].m_Channel, m_aQueue[0].m_SetId, 1.0f, vec2(0,0));
|
||||
m_QueueWaitTime = Now+time_freq()*3/10; // wait 300ms before playing the next one
|
||||
if(--m_QueuePos > 0)
|
||||
mem_move(m_aQueue, m_aQueue+1, m_QueuePos*sizeof(int));
|
||||
mem_move(m_aQueue, m_aQueue+1, m_QueuePos*sizeof(QueueEntry));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,11 +104,17 @@ void CSounds::ClearQueue()
|
|||
m_QueueWaitTime = time_get();
|
||||
}
|
||||
|
||||
void CSounds::Enqueue(int SetId)
|
||||
void CSounds::Enqueue(int Channel, int SetId)
|
||||
{
|
||||
// add sound to the queue
|
||||
if(!g_Config.m_ClEditor && m_QueuePos < QUEUE_SIZE)
|
||||
m_aQueue[m_QueuePos++] = SetId;
|
||||
if(m_QueuePos < QUEUE_SIZE)
|
||||
{
|
||||
if(Channel == CHN_MUSIC || !g_Config.m_ClEditor)
|
||||
{
|
||||
m_aQueue[m_QueuePos].m_Channel = Channel;
|
||||
m_aQueue[m_QueuePos++].m_SetId = SetId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CSounds::PlayAndRecord(int Chn, int SetId, float Vol, vec2 Pos)
|
||||
|
@ -117,7 +128,7 @@ void CSounds::PlayAndRecord(int Chn, int SetId, float Vol, vec2 Pos)
|
|||
|
||||
void CSounds::Play(int Chn, int SetId, float Vol, vec2 Pos)
|
||||
{
|
||||
if(m_WaitForSoundJob || SetId < 0 || SetId >= g_pData->m_NumSounds)
|
||||
if(!g_Config.m_SndEnable || (Chn == CHN_MUSIC && !g_Config.m_SndMusic) || m_WaitForSoundJob || SetId < 0 || SetId >= g_pData->m_NumSounds)
|
||||
return;
|
||||
|
||||
SOUNDSET *pSet = &g_pData->m_aSounds[SetId];
|
||||
|
@ -125,9 +136,13 @@ void CSounds::Play(int Chn, int SetId, float Vol, vec2 Pos)
|
|||
if(!pSet->m_NumSounds)
|
||||
return;
|
||||
|
||||
int Flags = 0;
|
||||
if(Chn == CHN_MUSIC)
|
||||
Flags = ISound::FLAG_LOOP;
|
||||
|
||||
if(pSet->m_NumSounds == 1)
|
||||
{
|
||||
Sound()->PlayAt(Chn, pSet->m_aSounds[0].m_Id, 0, Pos.x, Pos.y);
|
||||
Sound()->PlayAt(Chn, pSet->m_aSounds[0].m_Id, Flags, Pos.x, Pos.y);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -138,6 +153,17 @@ void CSounds::Play(int Chn, int SetId, float Vol, vec2 Pos)
|
|||
Id = rand() % pSet->m_NumSounds;
|
||||
}
|
||||
while(Id == pSet->m_Last);
|
||||
Sound()->PlayAt(Chn, pSet->m_aSounds[Id].m_Id, 0, Pos.x, Pos.y);
|
||||
Sound()->PlayAt(Chn, pSet->m_aSounds[Id].m_Id, Flags, Pos.x, Pos.y);
|
||||
pSet->m_Last = Id;
|
||||
}
|
||||
|
||||
void CSounds::Stop(int SetId)
|
||||
{
|
||||
if(m_WaitForSoundJob || SetId < 0 || SetId >= g_pData->m_NumSounds)
|
||||
return;
|
||||
|
||||
SOUNDSET *pSet = &g_pData->m_aSounds[SetId];
|
||||
|
||||
for(int i = 0; i < pSet->m_NumSounds; i++)
|
||||
Sound()->Stop(pSet->m_aSounds[i].m_Id);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,11 @@ class CSounds : public CComponent
|
|||
{
|
||||
QUEUE_SIZE = 32,
|
||||
};
|
||||
int m_aQueue[QUEUE_SIZE];
|
||||
struct QueueEntry
|
||||
{
|
||||
int m_Channel;
|
||||
int m_SetId;
|
||||
} m_aQueue[QUEUE_SIZE];
|
||||
int m_QueuePos;
|
||||
int64 m_QueueWaitTime;
|
||||
class CJob m_SoundJob;
|
||||
|
@ -31,9 +35,10 @@ public:
|
|||
virtual void OnRender();
|
||||
|
||||
void ClearQueue();
|
||||
void Enqueue(int SetId);
|
||||
void Enqueue(int Channel, int SetId);
|
||||
void Play(int Channel, int SetId, float Vol, vec2 Pos);
|
||||
void PlayAndRecord(int Channel, int SetId, float Vol, vec2 Pos);
|
||||
void Stop(int SetId);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ void CSpectator::OnRender()
|
|||
float FontSize = 20.0f;
|
||||
float StartY = -190.0f;
|
||||
float LineHeight = 60.0f;
|
||||
bool Selected = false;
|
||||
bool Selected = false;
|
||||
|
||||
if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW)
|
||||
{
|
||||
|
|
|
@ -571,7 +571,7 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker)
|
|||
if(pMsg->m_SoundID == SOUND_CTF_DROP || pMsg->m_SoundID == SOUND_CTF_RETURN ||
|
||||
pMsg->m_SoundID == SOUND_CTF_CAPTURE || pMsg->m_SoundID == SOUND_CTF_GRAB_EN ||
|
||||
pMsg->m_SoundID == SOUND_CTF_GRAB_PL)
|
||||
g_GameClient.m_pSounds->Enqueue(pMsg->m_SoundID);
|
||||
g_GameClient.m_pSounds->Enqueue(CSounds::CHN_GLOBAL, pMsg->m_SoundID);
|
||||
else
|
||||
g_GameClient.m_pSounds->Play(CSounds::CHN_GLOBAL, pMsg->m_SoundID, 1.0f, vec2(0,0));
|
||||
}
|
||||
|
@ -1050,7 +1050,7 @@ void CGameClient::OnPredict()
|
|||
if(((int *)&Before)[i] != ((int *)&Now)[i])
|
||||
{
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), " %d %d %d (%d %d)", i, ((int *)&Before)[i], ((int *)&Now)[i], ((int *)&BeforePrev)[i], ((int *)&NowPrev)[i]);
|
||||
str_format(aBuf, sizeof(aBuf), " %d %d %d (%d %d)", i, ((int *)&Before)[i], ((int *)&Now)[i], ((int *)&BeforePrev)[i], ((int *)&NowPrev)[i]);
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "client", aBuf);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -262,12 +262,12 @@ private:
|
|||
|
||||
inline float HueToRgb(float v1, float v2, float h)
|
||||
{
|
||||
if(h < 0.0f) h += 1;
|
||||
if(h > 1.0f) h -= 1;
|
||||
if((6.0f * h) < 1.0f) return v1 + (v2 - v1) * 6.0f * h;
|
||||
if((2.0f * h) < 1.0f) return v2;
|
||||
if((3.0f * h) < 2.0f) return v1 + (v2 - v1) * ((2.0f/3.0f) - h) * 6.0f;
|
||||
return v1;
|
||||
if(h < 0.0f) h += 1;
|
||||
if(h > 1.0f) h -= 1;
|
||||
if((6.0f * h) < 1.0f) return v1 + (v2 - v1) * 6.0f * h;
|
||||
if((2.0f * h) < 1.0f) return v2;
|
||||
if((3.0f * h) < 2.0f) return v1 + (v2 - v1) * ((2.0f/3.0f) - h) * 6.0f;
|
||||
return v1;
|
||||
}
|
||||
|
||||
inline vec3 HslToRgb(vec3 HSL)
|
||||
|
|
|
@ -33,43 +33,43 @@ CUI::CUI()
|
|||
|
||||
int CUI::Update(float Mx, float My, float Mwx, float Mwy, int Buttons)
|
||||
{
|
||||
m_MouseX = Mx;
|
||||
m_MouseY = My;
|
||||
m_MouseWorldX = Mwx;
|
||||
m_MouseWorldY = Mwy;
|
||||
m_LastMouseButtons = m_MouseButtons;
|
||||
m_MouseButtons = Buttons;
|
||||
m_pHotItem = m_pBecommingHotItem;
|
||||
if(m_pActiveItem)
|
||||
m_pHotItem = m_pActiveItem;
|
||||
m_pBecommingHotItem = 0;
|
||||
return 0;
|
||||
m_MouseX = Mx;
|
||||
m_MouseY = My;
|
||||
m_MouseWorldX = Mwx;
|
||||
m_MouseWorldY = Mwy;
|
||||
m_LastMouseButtons = m_MouseButtons;
|
||||
m_MouseButtons = Buttons;
|
||||
m_pHotItem = m_pBecommingHotItem;
|
||||
if(m_pActiveItem)
|
||||
m_pHotItem = m_pActiveItem;
|
||||
m_pBecommingHotItem = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CUI::MouseInside(const CUIRect *r)
|
||||
{
|
||||
if(m_MouseX >= r->x && m_MouseX <= r->x+r->w && m_MouseY >= r->y && m_MouseY <= r->y+r->h)
|
||||
return 1;
|
||||
return 0;
|
||||
if(m_MouseX >= r->x && m_MouseX <= r->x+r->w && m_MouseY >= r->y && m_MouseY <= r->y+r->h)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
CUIRect *CUI::Screen()
|
||||
{
|
||||
float Aspect = Graphics()->ScreenAspect();
|
||||
float w, h;
|
||||
float Aspect = Graphics()->ScreenAspect();
|
||||
float w, h;
|
||||
|
||||
h = 600;
|
||||
w = Aspect*h;
|
||||
h = 600;
|
||||
w = Aspect*h;
|
||||
|
||||
m_Screen.w = w;
|
||||
m_Screen.h = h;
|
||||
m_Screen.w = w;
|
||||
m_Screen.h = h;
|
||||
|
||||
return &m_Screen;
|
||||
return &m_Screen;
|
||||
}
|
||||
|
||||
void CUI::SetScale(float s)
|
||||
{
|
||||
g_Config.m_UiScale = (int)(s*100.0f);
|
||||
g_Config.m_UiScale = (int)(s*100.0f);
|
||||
}
|
||||
|
||||
float CUI::Scale()
|
||||
|
@ -97,175 +97,175 @@ void CUI::ClipDisable()
|
|||
void CUIRect::HSplitMid(CUIRect *pTop, CUIRect *pBottom) const
|
||||
{
|
||||
CUIRect r = *this;
|
||||
float Cut = r.h/2;
|
||||
float Cut = r.h/2;
|
||||
|
||||
if(pTop)
|
||||
{
|
||||
pTop->x = r.x;
|
||||
pTop->y = r.y;
|
||||
pTop->w = r.w;
|
||||
pTop->h = Cut;
|
||||
}
|
||||
if(pTop)
|
||||
{
|
||||
pTop->x = r.x;
|
||||
pTop->y = r.y;
|
||||
pTop->w = r.w;
|
||||
pTop->h = Cut;
|
||||
}
|
||||
|
||||
if(pBottom)
|
||||
{
|
||||
pBottom->x = r.x;
|
||||
pBottom->y = r.y + Cut;
|
||||
pBottom->w = r.w;
|
||||
pBottom->h = r.h - Cut;
|
||||
}
|
||||
if(pBottom)
|
||||
{
|
||||
pBottom->x = r.x;
|
||||
pBottom->y = r.y + Cut;
|
||||
pBottom->w = r.w;
|
||||
pBottom->h = r.h - Cut;
|
||||
}
|
||||
}
|
||||
|
||||
void CUIRect::HSplitTop(float Cut, CUIRect *pTop, CUIRect *pBottom) const
|
||||
{
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
|
||||
if (pTop)
|
||||
{
|
||||
pTop->x = r.x;
|
||||
pTop->y = r.y;
|
||||
pTop->w = r.w;
|
||||
pTop->h = Cut;
|
||||
}
|
||||
if (pTop)
|
||||
{
|
||||
pTop->x = r.x;
|
||||
pTop->y = r.y;
|
||||
pTop->w = r.w;
|
||||
pTop->h = Cut;
|
||||
}
|
||||
|
||||
if (pBottom)
|
||||
{
|
||||
pBottom->x = r.x;
|
||||
pBottom->y = r.y + Cut;
|
||||
pBottom->w = r.w;
|
||||
pBottom->h = r.h - Cut;
|
||||
}
|
||||
if (pBottom)
|
||||
{
|
||||
pBottom->x = r.x;
|
||||
pBottom->y = r.y + Cut;
|
||||
pBottom->w = r.w;
|
||||
pBottom->h = r.h - Cut;
|
||||
}
|
||||
}
|
||||
|
||||
void CUIRect::HSplitBottom(float Cut, CUIRect *pTop, CUIRect *pBottom) const
|
||||
{
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
|
||||
if (pTop)
|
||||
{
|
||||
pTop->x = r.x;
|
||||
pTop->y = r.y;
|
||||
pTop->w = r.w;
|
||||
pTop->h = r.h - Cut;
|
||||
}
|
||||
if (pTop)
|
||||
{
|
||||
pTop->x = r.x;
|
||||
pTop->y = r.y;
|
||||
pTop->w = r.w;
|
||||
pTop->h = r.h - Cut;
|
||||
}
|
||||
|
||||
if (pBottom)
|
||||
{
|
||||
pBottom->x = r.x;
|
||||
pBottom->y = r.y + r.h - Cut;
|
||||
pBottom->w = r.w;
|
||||
pBottom->h = Cut;
|
||||
}
|
||||
if (pBottom)
|
||||
{
|
||||
pBottom->x = r.x;
|
||||
pBottom->y = r.y + r.h - Cut;
|
||||
pBottom->w = r.w;
|
||||
pBottom->h = Cut;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CUIRect::VSplitMid(CUIRect *pLeft, CUIRect *pRight) const
|
||||
{
|
||||
CUIRect r = *this;
|
||||
float Cut = r.w/2;
|
||||
// Cut *= Scale();
|
||||
CUIRect r = *this;
|
||||
float Cut = r.w/2;
|
||||
// Cut *= Scale();
|
||||
|
||||
if (pLeft)
|
||||
{
|
||||
pLeft->x = r.x;
|
||||
pLeft->y = r.y;
|
||||
pLeft->w = Cut;
|
||||
pLeft->h = r.h;
|
||||
}
|
||||
if (pLeft)
|
||||
{
|
||||
pLeft->x = r.x;
|
||||
pLeft->y = r.y;
|
||||
pLeft->w = Cut;
|
||||
pLeft->h = r.h;
|
||||
}
|
||||
|
||||
if (pRight)
|
||||
{
|
||||
pRight->x = r.x + Cut;
|
||||
pRight->y = r.y;
|
||||
pRight->w = r.w - Cut;
|
||||
pRight->h = r.h;
|
||||
}
|
||||
if (pRight)
|
||||
{
|
||||
pRight->x = r.x + Cut;
|
||||
pRight->y = r.y;
|
||||
pRight->w = r.w - Cut;
|
||||
pRight->h = r.h;
|
||||
}
|
||||
}
|
||||
|
||||
void CUIRect::VSplitLeft(float Cut, CUIRect *pLeft, CUIRect *pRight) const
|
||||
{
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
|
||||
if (pLeft)
|
||||
{
|
||||
pLeft->x = r.x;
|
||||
pLeft->y = r.y;
|
||||
pLeft->w = Cut;
|
||||
pLeft->h = r.h;
|
||||
}
|
||||
if (pLeft)
|
||||
{
|
||||
pLeft->x = r.x;
|
||||
pLeft->y = r.y;
|
||||
pLeft->w = Cut;
|
||||
pLeft->h = r.h;
|
||||
}
|
||||
|
||||
if (pRight)
|
||||
{
|
||||
pRight->x = r.x + Cut;
|
||||
pRight->y = r.y;
|
||||
pRight->w = r.w - Cut;
|
||||
pRight->h = r.h;
|
||||
}
|
||||
if (pRight)
|
||||
{
|
||||
pRight->x = r.x + Cut;
|
||||
pRight->y = r.y;
|
||||
pRight->w = r.w - Cut;
|
||||
pRight->h = r.h;
|
||||
}
|
||||
}
|
||||
|
||||
void CUIRect::VSplitRight(float Cut, CUIRect *pLeft, CUIRect *pRight) const
|
||||
{
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
|
||||
if (pLeft)
|
||||
{
|
||||
pLeft->x = r.x;
|
||||
pLeft->y = r.y;
|
||||
pLeft->w = r.w - Cut;
|
||||
pLeft->h = r.h;
|
||||
}
|
||||
if (pLeft)
|
||||
{
|
||||
pLeft->x = r.x;
|
||||
pLeft->y = r.y;
|
||||
pLeft->w = r.w - Cut;
|
||||
pLeft->h = r.h;
|
||||
}
|
||||
|
||||
if (pRight)
|
||||
{
|
||||
pRight->x = r.x + r.w - Cut;
|
||||
pRight->y = r.y;
|
||||
pRight->w = Cut;
|
||||
pRight->h = r.h;
|
||||
}
|
||||
if (pRight)
|
||||
{
|
||||
pRight->x = r.x + r.w - Cut;
|
||||
pRight->y = r.y;
|
||||
pRight->w = Cut;
|
||||
pRight->h = r.h;
|
||||
}
|
||||
}
|
||||
|
||||
void CUIRect::Margin(float Cut, CUIRect *pOtherRect) const
|
||||
{
|
||||
CUIRect r = *this;
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
|
||||
pOtherRect->x = r.x + Cut;
|
||||
pOtherRect->y = r.y + Cut;
|
||||
pOtherRect->w = r.w - 2*Cut;
|
||||
pOtherRect->h = r.h - 2*Cut;
|
||||
pOtherRect->x = r.x + Cut;
|
||||
pOtherRect->y = r.y + Cut;
|
||||
pOtherRect->w = r.w - 2*Cut;
|
||||
pOtherRect->h = r.h - 2*Cut;
|
||||
}
|
||||
|
||||
void CUIRect::VMargin(float Cut, CUIRect *pOtherRect) const
|
||||
{
|
||||
CUIRect r = *this;
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
|
||||
pOtherRect->x = r.x + Cut;
|
||||
pOtherRect->y = r.y;
|
||||
pOtherRect->w = r.w - 2*Cut;
|
||||
pOtherRect->h = r.h;
|
||||
pOtherRect->x = r.x + Cut;
|
||||
pOtherRect->y = r.y;
|
||||
pOtherRect->w = r.w - 2*Cut;
|
||||
pOtherRect->h = r.h;
|
||||
}
|
||||
|
||||
void CUIRect::HMargin(float Cut, CUIRect *pOtherRect) const
|
||||
{
|
||||
CUIRect r = *this;
|
||||
CUIRect r = *this;
|
||||
Cut *= Scale();
|
||||
|
||||
pOtherRect->x = r.x;
|
||||
pOtherRect->y = r.y + Cut;
|
||||
pOtherRect->w = r.w;
|
||||
pOtherRect->h = r.h - 2*Cut;
|
||||
pOtherRect->x = r.x;
|
||||
pOtherRect->y = r.y + Cut;
|
||||
pOtherRect->w = r.w;
|
||||
pOtherRect->h = r.h - 2*Cut;
|
||||
}
|
||||
|
||||
int CUI::DoButtonLogic(const void *pID, const char *pText, int Checked, const CUIRect *pRect)
|
||||
{
|
||||
// logic
|
||||
int ReturnValue = 0;
|
||||
int Inside = MouseInside(pRect);
|
||||
// logic
|
||||
int ReturnValue = 0;
|
||||
int Inside = MouseInside(pRect);
|
||||
static int ButtonUsed = 0;
|
||||
|
||||
if(ActiveItem() == pID)
|
||||
|
@ -295,14 +295,14 @@ int CUI::DoButtonLogic(const void *pID, const char *pText, int Checked, const CU
|
|||
if(Inside)
|
||||
SetHotItem(pID);
|
||||
|
||||
return ReturnValue;
|
||||
return ReturnValue;
|
||||
}
|
||||
/*
|
||||
int CUI::DoButton(const void *id, const char *text, int checked, const CUIRect *r, ui_draw_button_func draw_func, const void *extra)
|
||||
{
|
||||
// logic
|
||||
int ret = 0;
|
||||
int inside = ui_MouseInside(r);
|
||||
// logic
|
||||
int ret = 0;
|
||||
int inside = ui_MouseInside(r);
|
||||
static int button_used = 0;
|
||||
|
||||
if(ui_ActiveItem() == id)
|
||||
|
@ -333,29 +333,29 @@ int CUI::DoButton(const void *id, const char *text, int checked, const CUIRect *
|
|||
ui_SetHotItem(id);
|
||||
|
||||
if(draw_func)
|
||||
draw_func(id, text, checked, r, extra);
|
||||
return ret;
|
||||
draw_func(id, text, checked, r, extra);
|
||||
return ret;
|
||||
}*/
|
||||
|
||||
void CUI::DoLabel(const CUIRect *r, const char *pText, float Size, int Align, int MaxWidth)
|
||||
{
|
||||
// TODO: FIX ME!!!!
|
||||
//Graphics()->BlendNormal();
|
||||
if(Align == 0)
|
||||
{
|
||||
float tw = TextRender()->TextWidth(0, Size, pText, MaxWidth);
|
||||
TextRender()->Text(0, r->x + r->w/2-tw/2, r->y - Size/10, Size, pText, MaxWidth);
|
||||
//Graphics()->BlendNormal();
|
||||
if(Align == 0)
|
||||
{
|
||||
float tw = TextRender()->TextWidth(0, Size, pText, MaxWidth);
|
||||
TextRender()->Text(0, r->x + r->w/2-tw/2, r->y - Size/10, Size, pText, MaxWidth);
|
||||
}
|
||||
else if(Align < 0)
|
||||
TextRender()->Text(0, r->x, r->y - Size/10, Size, pText, MaxWidth);
|
||||
TextRender()->Text(0, r->x, r->y - Size/10, Size, pText, MaxWidth);
|
||||
else if(Align > 0)
|
||||
{
|
||||
float tw = TextRender()->TextWidth(0, Size, pText, MaxWidth);
|
||||
TextRender()->Text(0, r->x + r->w-tw, r->y - Size/10, Size, pText, MaxWidth);
|
||||
float tw = TextRender()->TextWidth(0, Size, pText, MaxWidth);
|
||||
TextRender()->Text(0, r->x + r->w-tw, r->y - Size/10, Size, pText, MaxWidth);
|
||||
}
|
||||
}
|
||||
|
||||
void CUI::DoLabelScaled(const CUIRect *r, const char *pText, float Size, int Align, int MaxWidth)
|
||||
{
|
||||
DoLabel(r, pText, Size*Scale(), Align, MaxWidth);
|
||||
DoLabel(r, pText, Size*Scale(), Align, MaxWidth);
|
||||
}
|
|
@ -8,7 +8,7 @@ class CUIRect
|
|||
// TODO: Refactor: Redo UI scaling
|
||||
float Scale() const;
|
||||
public:
|
||||
float x, y, w, h;
|
||||
float x, y, w, h;
|
||||
|
||||
void HSplitMid(CUIRect *pTop, CUIRect *pBottom) const;
|
||||
void HSplitTop(float Cut, CUIRect *pTop, CUIRect *pBottom) const;
|
||||
|
|
|
@ -2926,11 +2926,6 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
}
|
||||
else
|
||||
{
|
||||
if((Input()->KeyPressed(KEY_LCTRL) || Input()->KeyPressed(KEY_RCTRL)))
|
||||
pEnvelope->m_lPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY*0.001f);
|
||||
else
|
||||
pEnvelope->m_lPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY*ValueScale);
|
||||
|
||||
if(Input()->KeyPressed(KEY_LSHIFT) || Input()->KeyPressed(KEY_RSHIFT))
|
||||
{
|
||||
if(i != 0)
|
||||
|
@ -2945,6 +2940,13 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
pEnvelope->m_lPoints[i].m_Time = pEnvelope->m_lPoints[i+1].m_Time - 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if((Input()->KeyPressed(KEY_LCTRL) || Input()->KeyPressed(KEY_RCTRL)))
|
||||
pEnvelope->m_lPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY*0.001f);
|
||||
else
|
||||
pEnvelope->m_lPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY*ValueScale);
|
||||
}
|
||||
m_Map.m_Modified = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -403,7 +403,7 @@ public:
|
|||
|
||||
void PrepareForSave();
|
||||
|
||||
void GetSize(float *w, float *h) { *w = m_Width*32.0f; *h = m_Height*32.0f; }
|
||||
void GetSize(float *w, float *h) { *w = m_Width*32.0f; *h = m_Height*32.0f; }
|
||||
|
||||
int m_TexID;
|
||||
int m_Game;
|
||||
|
@ -680,7 +680,7 @@ public:
|
|||
|
||||
CEditorMap m_Map;
|
||||
|
||||
void DoMapBorder();
|
||||
void DoMapBorder();
|
||||
int DoButton_Editor_Common(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Flags, const char *pToolTip);
|
||||
int DoButton_Editor(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Flags, const char *pToolTip);
|
||||
|
||||
|
|
|
@ -356,7 +356,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
|
|||
{
|
||||
CMapItemLayerQuads Item;
|
||||
Item.m_Version = 1;
|
||||
Item.m_Layer.m_Flags = pLayer->m_Flags;
|
||||
Item.m_Layer.m_Flags = pLayer->m_Flags;
|
||||
Item.m_Layer.m_Type = pLayer->m_Type;
|
||||
Item.m_Image = pLayer->m_Image;
|
||||
|
||||
|
|
|
@ -286,9 +286,9 @@ void CLayerTiles::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
|
|||
continue;
|
||||
|
||||
if(Empty)
|
||||
m_pTiles[fy*m_Width+fx].m_Index = 1;
|
||||
else
|
||||
m_pTiles[fy*m_Width+fx] = pLt->m_pTiles[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)];
|
||||
m_pTiles[fy*m_Width+fx].m_Index = 1;
|
||||
else
|
||||
m_pTiles[fy*m_Width+fx] = pLt->m_pTiles[(y*pLt->m_Width + x%pLt->m_Width) % (pLt->m_Width*pLt->m_Height)];
|
||||
}
|
||||
}
|
||||
m_pEditor->m_Map.m_Modified = true;
|
||||
|
|
|
@ -476,10 +476,10 @@ void CCharacter::FireWeapon()
|
|||
}
|
||||
|
||||
m_AttackTick = Server()->Tick();
|
||||
/*
|
||||
if(m_aWeapons[m_ActiveWeapon].m_Ammo > 0) // -1 == unlimited
|
||||
m_aWeapons[m_ActiveWeapon].m_Ammo--;
|
||||
*/
|
||||
|
||||
/*if(m_aWeapons[m_ActiveWeapon].m_Ammo > 0) // -1 == unlimited
|
||||
m_aWeapons[m_ActiveWeapon].m_Ammo--;*/
|
||||
|
||||
if(!m_ReloadTimer)
|
||||
m_ReloadTimer = g_pData->m_Weapons.m_aId[m_ActiveWeapon].m_Firedelay * Server()->TickSpeed() / 1000;
|
||||
}
|
||||
|
@ -524,8 +524,8 @@ void CCharacter::HandleWeapons()
|
|||
{
|
||||
m_aWeapons[m_ActiveWeapon].m_AmmoRegenStart = -1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}*/
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -126,8 +126,8 @@ void CPickup::Tick()
|
|||
default:
|
||||
break;
|
||||
};
|
||||
/*
|
||||
if(RespawnTime >= 0)
|
||||
|
||||
/*if(RespawnTime >= 0)
|
||||
{
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "pickup player='%d:%s' item=%d/%d",
|
||||
|
|
|
@ -9,7 +9,7 @@ class CEventHandler
|
|||
static const int MAX_EVENTS = 128;
|
||||
static const int MAX_DATASIZE = 128*64;
|
||||
|
||||
int m_aTypes[MAX_EVENTS]; // TODO: remove some of these arrays
|
||||
int m_aTypes[MAX_EVENTS]; // TODO: remove some of these arrays
|
||||
int m_aOffsets[MAX_EVENTS];
|
||||
int m_aSizes[MAX_EVENTS];
|
||||
int m_aClientMasks[MAX_EVENTS];
|
||||
|
|
|
@ -567,7 +567,6 @@ void CGameContext::OnTick()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < m_NumMutes; i++)
|
||||
{
|
||||
if(m_aMutes[i].m_Expire <= Server()->Tick())
|
||||
|
|
|
@ -70,7 +70,7 @@ float IGameController::EvaluateSpawnPos(CSpawnEval *pEval, vec2 Pos)
|
|||
void IGameController::EvaluateSpawnType(CSpawnEval *pEval, int Type)
|
||||
{
|
||||
// get spawn point
|
||||
for(int i = 0; i < m_aNumSpawnPoints[Type]; i++)
|
||||
for(int i = 0; i < m_aNumSpawnPoints[Type]; i++)
|
||||
{
|
||||
/*// check if the position is occupado
|
||||
if(GameServer()->m_World.FindEntities(m_aaSpawnPoints[Type][i], 64, 0, 1, CGameWorld::ENTTYPE_CHARACTER))
|
||||
|
@ -90,7 +90,7 @@ void IGameController::EvaluateSpawnType(CSpawnEval *pEval, int Type)
|
|||
void IGameController::FindFreeSpawn(CSpawnEval *pEval, int Type)
|
||||
{
|
||||
// pick the spawn point that is least occupied and has free space for spawning around it
|
||||
for(int i = 0; i < m_aNumSpawnPoints[Type]; i++)
|
||||
for(int i = 0; i < m_aNumSpawnPoints[Type]; i++)
|
||||
{
|
||||
|
||||
CCharacter *aEnts[MAX_CLIENTS];
|
||||
|
@ -907,7 +907,7 @@ bool IGameController::CanChangeTeam(CPlayer *pPlayer, int JoinTeam)
|
|||
|
||||
void IGameController::DoPlayerScoreWincheck()
|
||||
{
|
||||
if(m_GameOverTick == -1 && !m_Warmup)
|
||||
if(m_GameOverTick == -1 && !m_Warmup)
|
||||
{
|
||||
// gather some stats
|
||||
int Topscore = 0;
|
||||
|
|
|
@ -186,9 +186,9 @@ void CPlayer::OnDisconnect(const char *pReason)
|
|||
{
|
||||
char aBuf[512];
|
||||
if(pReason && *pReason)
|
||||
str_format(aBuf, sizeof(aBuf), "'%s' has left the game (%s)", Server()->ClientName(m_ClientID), pReason);
|
||||
str_format(aBuf, sizeof(aBuf), "'%s' has left the game (%s)", Server()->ClientName(m_ClientID), pReason);
|
||||
else
|
||||
str_format(aBuf, sizeof(aBuf), "'%s' has left the game", Server()->ClientName(m_ClientID));
|
||||
str_format(aBuf, sizeof(aBuf), "'%s' has left the game", Server()->ClientName(m_ClientID));
|
||||
GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aBuf);
|
||||
|
||||
str_format(aBuf, sizeof(aBuf), "leave player='%d:%s'", m_ClientID, Server()->ClientName(m_ClientID));
|
||||
|
|
|
@ -41,7 +41,7 @@ MACRO_CONFIG_INT(PlayerColorBody, player_color_body, 65408, 0, 0xFFFFFF, CFGFLAG
|
|||
MACRO_CONFIG_INT(PlayerColorFeet, player_color_feet, 65408, 0, 0xFFFFFF, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Player feet color", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_STR(PlayerSkin, player_skin, 24, "default", CFGFLAG_CLIENT|CFGFLAG_SAVE, "Player skin", IConsole::CONSOLELEVEL_USER)
|
||||
|
||||
MACRO_CONFIG_INT(UiPage, ui_page, 5, 0, 9, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface page", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(UiPage, ui_page, 5, 0, 10, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface page", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(UiToolboxPage, ui_toolbox_page, 0, 0, 2, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Toolbox page", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_STR(UiServerAddress, ui_server_address, 64, "localhost:8303", CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface server address", IConsole::CONSOLELEVEL_USER)
|
||||
MACRO_CONFIG_INT(UiScale, ui_scale, 100, 50, 150, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface scale", IConsole::CONSOLELEVEL_USER)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef OSXLAUNCH_CLIENT_H
|
||||
#define OSXLAUNCH_CLIENT_H
|
||||
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
|
||||
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
|
||||
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
|
||||
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
|
||||
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
|
||||
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
|
||||
|
||||
Feel free to customize this file to suit your needs
|
||||
Feel free to customize this file to suit your needs
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
|
||||
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
|
||||
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
|
||||
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
|
||||
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
|
||||
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
|
||||
|
||||
Feel free to customize this file to suit your needs
|
||||
Feel free to customize this file to suit your needs
|
||||
*/
|
||||
|
||||
#import <SDL.h>
|
||||
|
@ -36,25 +36,25 @@ extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
|
|||
|
||||
#endif /* SDL_USE_CPS */
|
||||
|
||||
static int gArgc;
|
||||
static char **gArgv;
|
||||
static BOOL gFinderLaunch;
|
||||
static BOOL gCalledAppMainline = FALSE;
|
||||
static int gArgc;
|
||||
static char **gArgv;
|
||||
static BOOL gFinderLaunch;
|
||||
static BOOL gCalledAppMainline = FALSE;
|
||||
|
||||
static NSString *getApplicationName(void)
|
||||
{
|
||||
NSDictionary *dict;
|
||||
NSString *appName = 0;
|
||||
NSDictionary *dict;
|
||||
NSString *appName = 0;
|
||||
|
||||
/* Determine the application name */
|
||||
dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
|
||||
if (dict)
|
||||
appName = [dict objectForKey: @"CFBundleName"];
|
||||
/* Determine the application name */
|
||||
dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
|
||||
if (dict)
|
||||
appName = [dict objectForKey: @"CFBundleName"];
|
||||
|
||||
if (![appName length])
|
||||
appName = [[NSProcessInfo processInfo] processName];
|
||||
if (![appName length])
|
||||
appName = [[NSProcessInfo processInfo] processName];
|
||||
|
||||
return appName;
|
||||
return appName;
|
||||
}
|
||||
|
||||
#if SDL_USE_NIB_FILE
|
||||
|
@ -71,10 +71,10 @@ static NSString *getApplicationName(void)
|
|||
/* Invoked from the Quit menu item */
|
||||
- (void)terminate:(id)sender
|
||||
{
|
||||
/* Post a SDL_QUIT event */
|
||||
SDL_Event event;
|
||||
event.type = SDL_QUIT;
|
||||
SDL_PushEvent(&event);
|
||||
/* Post a SDL_QUIT event */
|
||||
SDL_Event event;
|
||||
event.type = SDL_QUIT;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -93,133 +93,133 @@ static NSString *getApplicationName(void)
|
|||
/* Fix menu to contain the real app name instead of "SDL App" */
|
||||
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
|
||||
{
|
||||
NSRange aRange;
|
||||
NSEnumerator *enumerator;
|
||||
NSMenuItem *menuItem;
|
||||
NSRange aRange;
|
||||
NSEnumerator *enumerator;
|
||||
NSMenuItem *menuItem;
|
||||
|
||||
aRange = [[aMenu title] rangeOfString:@"SDL App"];
|
||||
if (aRange.length != 0)
|
||||
[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
|
||||
aRange = [[aMenu title] rangeOfString:@"SDL App"];
|
||||
if (aRange.length != 0)
|
||||
[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
|
||||
|
||||
enumerator = [[aMenu itemArray] objectEnumerator];
|
||||
while ((menuItem = [enumerator nextObject]))
|
||||
{
|
||||
aRange = [[menuItem title] rangeOfString:@"SDL App"];
|
||||
if (aRange.length != 0)
|
||||
[menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
|
||||
if ([menuItem hasSubmenu])
|
||||
[self fixMenu:[menuItem submenu] withAppName:appName];
|
||||
}
|
||||
[ aMenu sizeToFit ];
|
||||
enumerator = [[aMenu itemArray] objectEnumerator];
|
||||
while ((menuItem = [enumerator nextObject]))
|
||||
{
|
||||
aRange = [[menuItem title] rangeOfString:@"SDL App"];
|
||||
if (aRange.length != 0)
|
||||
[menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
|
||||
if ([menuItem hasSubmenu])
|
||||
[self fixMenu:[menuItem submenu] withAppName:appName];
|
||||
}
|
||||
[ aMenu sizeToFit ];
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void setApplicationMenu(void)
|
||||
{
|
||||
/* warning: this code is very odd */
|
||||
NSMenu *appleMenu;
|
||||
NSMenuItem *menuItem;
|
||||
NSString *title;
|
||||
NSString *appName;
|
||||
/* warning: this code is very odd */
|
||||
NSMenu *appleMenu;
|
||||
NSMenuItem *menuItem;
|
||||
NSString *title;
|
||||
NSString *appName;
|
||||
|
||||
appName = getApplicationName();
|
||||
appleMenu = [[NSMenu alloc] initWithTitle:@""];
|
||||
appName = getApplicationName();
|
||||
appleMenu = [[NSMenu alloc] initWithTitle:@""];
|
||||
|
||||
/* Add menu items */
|
||||
title = [@"About " stringByAppendingString:appName];
|
||||
[appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
|
||||
/* Add menu items */
|
||||
title = [@"About " stringByAppendingString:appName];
|
||||
[appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
|
||||
|
||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
title = [@"Hide " stringByAppendingString:appName];
|
||||
[appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
|
||||
title = [@"Hide " stringByAppendingString:appName];
|
||||
[appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
|
||||
|
||||
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
|
||||
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
|
||||
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
|
||||
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
|
||||
|
||||
[appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
|
||||
[appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
|
||||
|
||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
title = [@"Quit " stringByAppendingString:appName];
|
||||
[appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
|
||||
title = [@"Quit " stringByAppendingString:appName];
|
||||
[appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
|
||||
|
||||
|
||||
/* Put menu into the menubar */
|
||||
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
|
||||
[menuItem setSubmenu:appleMenu];
|
||||
[[NSApp mainMenu] addItem:menuItem];
|
||||
/* Put menu into the menubar */
|
||||
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
|
||||
[menuItem setSubmenu:appleMenu];
|
||||
[[NSApp mainMenu] addItem:menuItem];
|
||||
|
||||
/* Tell the application object that this is now the application menu */
|
||||
[NSApp setAppleMenu:appleMenu];
|
||||
/* Tell the application object that this is now the application menu */
|
||||
[NSApp setAppleMenu:appleMenu];
|
||||
|
||||
/* Finally give up our references to the objects */
|
||||
[appleMenu release];
|
||||
[menuItem release];
|
||||
/* Finally give up our references to the objects */
|
||||
[appleMenu release];
|
||||
[menuItem release];
|
||||
}
|
||||
|
||||
/* Create a window menu */
|
||||
static void setupWindowMenu(void)
|
||||
{
|
||||
NSMenu *windowMenu;
|
||||
NSMenuItem *windowMenuItem;
|
||||
NSMenuItem *menuItem;
|
||||
NSMenu *windowMenu;
|
||||
NSMenuItem *windowMenuItem;
|
||||
NSMenuItem *menuItem;
|
||||
|
||||
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
|
||||
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
|
||||
|
||||
/* "Minimize" item */
|
||||
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
|
||||
[windowMenu addItem:menuItem];
|
||||
[menuItem release];
|
||||
/* "Minimize" item */
|
||||
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
|
||||
[windowMenu addItem:menuItem];
|
||||
[menuItem release];
|
||||
|
||||
/* Put menu into the menubar */
|
||||
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
|
||||
[windowMenuItem setSubmenu:windowMenu];
|
||||
[[NSApp mainMenu] addItem:windowMenuItem];
|
||||
/* Put menu into the menubar */
|
||||
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
|
||||
[windowMenuItem setSubmenu:windowMenu];
|
||||
[[NSApp mainMenu] addItem:windowMenuItem];
|
||||
|
||||
/* Tell the application object that this is now the window menu */
|
||||
[NSApp setWindowsMenu:windowMenu];
|
||||
/* Tell the application object that this is now the window menu */
|
||||
[NSApp setWindowsMenu:windowMenu];
|
||||
|
||||
/* Finally give up our references to the objects */
|
||||
[windowMenu release];
|
||||
[windowMenuItem release];
|
||||
/* Finally give up our references to the objects */
|
||||
[windowMenu release];
|
||||
[windowMenuItem release];
|
||||
}
|
||||
|
||||
/* Replacement for NSApplicationMain */
|
||||
static void CustomApplicationMain (int argc, char **argv)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
SDLMain *sdlMain;
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
SDLMain *sdlMain;
|
||||
|
||||
/* Ensure the application object is initialised */
|
||||
[SDLApplication sharedApplication];
|
||||
/* Ensure the application object is initialised */
|
||||
[SDLApplication sharedApplication];
|
||||
|
||||
#ifdef SDL_USE_CPS
|
||||
{
|
||||
CPSProcessSerNum PSN;
|
||||
/* Tell the dock about us */
|
||||
if (!CPSGetCurrentProcess(&PSN))
|
||||
if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
|
||||
if (!CPSSetFrontProcess(&PSN))
|
||||
[SDLApplication sharedApplication];
|
||||
}
|
||||
{
|
||||
CPSProcessSerNum PSN;
|
||||
/* Tell the dock about us */
|
||||
if (!CPSGetCurrentProcess(&PSN))
|
||||
if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
|
||||
if (!CPSSetFrontProcess(&PSN))
|
||||
[SDLApplication sharedApplication];
|
||||
}
|
||||
#endif /* SDL_USE_CPS */
|
||||
|
||||
/* Set up the menubar */
|
||||
[NSApp setMainMenu:[[NSMenu alloc] init]];
|
||||
setApplicationMenu();
|
||||
setupWindowMenu();
|
||||
/* Set up the menubar */
|
||||
[NSApp setMainMenu:[[NSMenu alloc] init]];
|
||||
setApplicationMenu();
|
||||
setupWindowMenu();
|
||||
|
||||
/* Create SDLMain and make it the app delegate */
|
||||
sdlMain = [[SDLMain alloc] init];
|
||||
[NSApp setDelegate:sdlMain];
|
||||
/* Create SDLMain and make it the app delegate */
|
||||
sdlMain = [[SDLMain alloc] init];
|
||||
[NSApp setDelegate:sdlMain];
|
||||
|
||||
/* Start the main event loop */
|
||||
[NSApp run];
|
||||
/* Start the main event loop */
|
||||
[NSApp run];
|
||||
|
||||
[sdlMain release];
|
||||
[pool release];
|
||||
[sdlMain release];
|
||||
[pool release];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -227,14 +227,14 @@ static void CustomApplicationMain (int argc, char **argv)
|
|||
|
||||
/*
|
||||
* Catch document open requests...this lets us notice files when the app
|
||||
* was launched by double-clicking a document, or when a document was
|
||||
* dragged/dropped on the app's icon. You need to have a
|
||||
* CFBundleDocumentsType section in your Info.plist to get this message,
|
||||
* apparently.
|
||||
* was launched by double-clicking a document, or when a document was
|
||||
* dragged/dropped on the app's icon. You need to have a
|
||||
* CFBundleDocumentsType section in your Info.plist to get this message,
|
||||
* apparently.
|
||||
*
|
||||
* Files are added to gArgv, so to the app, they'll look like command line
|
||||
* arguments. Previously, apps launched from the finder had nothing but
|
||||
* an argv[0].
|
||||
* arguments. Previously, apps launched from the finder had nothing but
|
||||
* an argv[0].
|
||||
*
|
||||
* This message may be received multiple times to open several docs on launch.
|
||||
*
|
||||
|
@ -242,57 +242,57 @@ static void CustomApplicationMain (int argc, char **argv)
|
|||
*/
|
||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
||||
{
|
||||
const char *temparg;
|
||||
size_t arglen;
|
||||
char *arg;
|
||||
char **newargv;
|
||||
const char *temparg;
|
||||
size_t arglen;
|
||||
char *arg;
|
||||
char **newargv;
|
||||
|
||||
if (!gFinderLaunch) /* MacOS is passing command line args. */
|
||||
return FALSE;
|
||||
if (!gFinderLaunch) /* MacOS is passing command line args. */
|
||||
return FALSE;
|
||||
|
||||
if (gCalledAppMainline) /* app has started, ignore this document. */
|
||||
return FALSE;
|
||||
if (gCalledAppMainline) /* app has started, ignore this document. */
|
||||
return FALSE;
|
||||
|
||||
temparg = [filename UTF8String];
|
||||
arglen = SDL_strlen(temparg) + 1;
|
||||
arg = (char *) SDL_malloc(arglen);
|
||||
if (arg == NULL)
|
||||
return FALSE;
|
||||
temparg = [filename UTF8String];
|
||||
arglen = SDL_strlen(temparg) + 1;
|
||||
arg = (char *) SDL_malloc(arglen);
|
||||
if (arg == NULL)
|
||||
return FALSE;
|
||||
|
||||
newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
|
||||
if (newargv == NULL)
|
||||
{
|
||||
SDL_free(arg);
|
||||
return FALSE;
|
||||
}
|
||||
gArgv = newargv;
|
||||
newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
|
||||
if (newargv == NULL)
|
||||
{
|
||||
SDL_free(arg);
|
||||
return FALSE;
|
||||
}
|
||||
gArgv = newargv;
|
||||
|
||||
SDL_strlcpy(arg, temparg, arglen);
|
||||
gArgv[gArgc++] = arg;
|
||||
gArgv[gArgc] = NULL;
|
||||
return TRUE;
|
||||
SDL_strlcpy(arg, temparg, arglen);
|
||||
gArgv[gArgc++] = arg;
|
||||
gArgv[gArgc] = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* Called when the internal event loop has just started running */
|
||||
- (void) applicationDidFinishLaunching: (NSNotification *) note
|
||||
{
|
||||
int status;
|
||||
int status;
|
||||
|
||||
/* Set the working directory to the .app's parent directory */
|
||||
[self setupWorkingDirectory:gFinderLaunch];
|
||||
/* Set the working directory to the .app's parent directory */
|
||||
[self setupWorkingDirectory:gFinderLaunch];
|
||||
|
||||
#if SDL_USE_NIB_FILE
|
||||
/* Set the main menu to contain the real app name instead of "SDL App" */
|
||||
[self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
|
||||
/* Set the main menu to contain the real app name instead of "SDL App" */
|
||||
[self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
|
||||
#endif
|
||||
|
||||
/* Hand off to main application code */
|
||||
gCalledAppMainline = TRUE;
|
||||
status = SDL_main (gArgc, gArgv);
|
||||
/* Hand off to main application code */
|
||||
gCalledAppMainline = TRUE;
|
||||
status = SDL_main (gArgc, gArgv);
|
||||
|
||||
/* We're done, thank you for playing */
|
||||
exit(status);
|
||||
/* We're done, thank you for playing */
|
||||
exit(status);
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -301,65 +301,65 @@ static void CustomApplicationMain (int argc, char **argv)
|
|||
|
||||
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
|
||||
{
|
||||
unsigned int bufferSize;
|
||||
unsigned int selfLen = [self length];
|
||||
unsigned int aStringLen = [aString length];
|
||||
unichar *buffer;
|
||||
NSRange localRange;
|
||||
NSString *result;
|
||||
unsigned int bufferSize;
|
||||
unsigned int selfLen = [self length];
|
||||
unsigned int aStringLen = [aString length];
|
||||
unichar *buffer;
|
||||
NSRange localRange;
|
||||
NSString *result;
|
||||
|
||||
bufferSize = selfLen + aStringLen - aRange.length;
|
||||
buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar));
|
||||
bufferSize = selfLen + aStringLen - aRange.length;
|
||||
buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar));
|
||||
|
||||
/* Get first part into buffer */
|
||||
localRange.location = 0;
|
||||
localRange.length = aRange.location;
|
||||
[self getCharacters:buffer range:localRange];
|
||||
/* Get first part into buffer */
|
||||
localRange.location = 0;
|
||||
localRange.length = aRange.location;
|
||||
[self getCharacters:buffer range:localRange];
|
||||
|
||||
/* Get middle part into buffer */
|
||||
localRange.location = 0;
|
||||
localRange.length = aStringLen;
|
||||
[aString getCharacters:(buffer+aRange.location) range:localRange];
|
||||
/* Get middle part into buffer */
|
||||
localRange.location = 0;
|
||||
localRange.length = aStringLen;
|
||||
[aString getCharacters:(buffer+aRange.location) range:localRange];
|
||||
|
||||
/* Get last part into buffer */
|
||||
localRange.location = aRange.location + aRange.length;
|
||||
localRange.length = selfLen - localRange.location;
|
||||
[self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
|
||||
/* Get last part into buffer */
|
||||
localRange.location = aRange.location + aRange.length;
|
||||
localRange.length = selfLen - localRange.location;
|
||||
[self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
|
||||
|
||||
/* Build output string */
|
||||
result = [NSString stringWithCharacters:buffer length:bufferSize];
|
||||
/* Build output string */
|
||||
result = [NSString stringWithCharacters:buffer length:bufferSize];
|
||||
|
||||
NSDeallocateMemoryPages(buffer, bufferSize);
|
||||
NSDeallocateMemoryPages(buffer, bufferSize);
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#ifdef main
|
||||
# undef main
|
||||
#undef main
|
||||
#endif
|
||||
|
||||
|
||||
/* Main entry point to executable - should *not* be SDL_main! */
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
/* Copy the arguments into a global variable */
|
||||
/* This is passed if we are launched by double-clicking */
|
||||
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
|
||||
gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
|
||||
gArgv[0] = argv[0];
|
||||
gArgv[1] = NULL;
|
||||
gArgc = 1;
|
||||
gFinderLaunch = YES;
|
||||
} else {
|
||||
int i;
|
||||
gArgc = argc;
|
||||
gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
|
||||
for (i = 0; i <= argc; i++)
|
||||
gArgv[i] = argv[i];
|
||||
gFinderLaunch = NO;
|
||||
}
|
||||
/* Copy the arguments into a global variable */
|
||||
/* This is passed if we are launched by double-clicking */
|
||||
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
|
||||
gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
|
||||
gArgv[0] = argv[0];
|
||||
gArgv[1] = NULL;
|
||||
gArgc = 1;
|
||||
gFinderLaunch = YES;
|
||||
} else {
|
||||
int i;
|
||||
gArgc = argc;
|
||||
gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
|
||||
for (i = 0; i <= argc; i++)
|
||||
gArgv[i] = argv[i];
|
||||
gFinderLaunch = NO;
|
||||
}
|
||||
|
||||
#if SDL_USE_NIB_FILE
|
||||
[SDLApplication poseAsClass:[NSApplication class]];
|
||||
|
@ -368,6 +368,6 @@ int main (int argc, char **argv)
|
|||
CustomApplicationMain (argc, argv);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
{
|
||||
NSPipe *pipe;
|
||||
task = t;
|
||||
pipe = [NSPipe pipe];
|
||||
[task setStandardOutput: pipe];
|
||||
file = [pipe fileHandleForReading];
|
||||
pipe = [NSPipe pipe];
|
||||
[task setStandardOutput: pipe];
|
||||
file = [pipe fileHandleForReading];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(outputNotification:) name: NSFileHandleReadCompletionNotification object: file];
|
||||
|
||||
|
@ -30,8 +30,8 @@
|
|||
|
||||
[[self textStorage] appendAttributedString: attrstr];
|
||||
int length = [[self textStorage] length];
|
||||
NSRange range = NSMakeRange(length, 0);
|
||||
[self scrollRangeToVisible: range];
|
||||
NSRange range = NSMakeRange(length, 0);
|
||||
[self scrollRangeToVisible: range];
|
||||
|
||||
[attrstr release];
|
||||
[string release];
|
||||
|
@ -41,17 +41,17 @@
|
|||
-(void)windowWillClose:(NSNotification *)notification
|
||||
{
|
||||
[task terminate];
|
||||
[NSApp terminate:self];
|
||||
[NSApp terminate:self];
|
||||
}
|
||||
@end
|
||||
|
||||
void runServer()
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSApp = [NSApplication sharedApplication];
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSApp = [NSApplication sharedApplication];
|
||||
NSBundle* mainBundle = [NSBundle mainBundle];
|
||||
NSTask *task;
|
||||
task = [[NSTask alloc] init];
|
||||
task = [[NSTask alloc] init];
|
||||
[task setCurrentDirectoryPath: [mainBundle resourcePath]];
|
||||
|
||||
// get a server config
|
||||
|
@ -100,8 +100,8 @@ void runServer()
|
|||
[NSApp run];
|
||||
[task terminate];
|
||||
|
||||
[NSApp release];
|
||||
[pool release];
|
||||
[NSApp release];
|
||||
[pool release];
|
||||
}
|
||||
|
||||
int main (int argc, char **argv)
|
||||
|
|
Loading…
Reference in a new issue