From a980f5ebb219becb856a2a1263a925750d847dc6 Mon Sep 17 00:00:00 2001 From: sauerbraten Date: Tue, 27 Apr 2021 12:01:18 +0200 Subject: [PATCH] embed keymap.cfg from svn r6499 --- Makefile | 25 ++-- data/p1xbraten/keymap.cfg | 138 ++++++++++++++++++ data/p1xbraten/keymap.cfg.gz.xxd | 71 +++++++++ ...xbraten_cfgs.patch => embedded_cfgs.patch} | 52 ++++--- src/Makefile | 17 ++- src/engine/main.cpp | 4 +- .../{p1xbraten_cfgs.cpp => embedded_cfgs.cpp} | 15 +- .../{p1xbraten_cfgs.h => embedded_cfgs.h} | 0 src/shared/igame.h | 2 +- src/vcpp/sauerbraten.vcxproj | 2 +- 10 files changed, 282 insertions(+), 44 deletions(-) create mode 100644 data/p1xbraten/keymap.cfg create mode 100644 data/p1xbraten/keymap.cfg.gz.xxd rename patches/{include_p1xbraten_cfgs.patch => embedded_cfgs.patch} (84%) rename src/fpsgame/{p1xbraten_cfgs.cpp => embedded_cfgs.cpp} (81%) rename src/fpsgame/{p1xbraten_cfgs.h => embedded_cfgs.h} (100%) diff --git a/Makefile b/Makefile index 89ea792..ebd25ab 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build install clean apply-patches gzip-menus _include-menus clean-sauer update-src apply-to-vanilla check-env +.PHONY: build install clean apply-patches gzip-cfgs embed-cfgs clean-sauer update-src apply-to-vanilla check-env PATCH=patch --strip=0 --remove-empty-files --ignore-whitespace @@ -8,7 +8,7 @@ ifneq (,$(wildcard ~/sauerbraten-code)) endif endif -build: update-src apply-patches gzip-menus _include-menus +build: update-src apply-patches embed-cfgs cd src && make install: @@ -32,7 +32,7 @@ apply-patches: $(PATCH) < patches/listteams.patch $(PATCH) < patches/extrapings.patch $(PATCH) < patches/execfile.patch - $(PATCH) < patches/include_p1xbraten_cfgs.patch + $(PATCH) < patches/embedded_cfgs.patch $(PATCH) < patches/tex_commands.patch $(PATCH) < patches/decouple_framedrawing.patch $(PATCH) < patches/crosshaircolor.patch @@ -45,18 +45,21 @@ apply-patches: unix2dos src/vcpp/sauerbraten.vcxproj cd src && make depend -gzip-menus: +gzip-cfgs: gzip --keep --force --best --no-name data/p1xbraten/menus.cfg && xxd -i - data/p1xbraten/menus.cfg.gz.xxd < data/p1xbraten/menus.cfg.gz gzip --keep --force --best --no-name data/p1xbraten/master.cfg && xxd -i - data/p1xbraten/master.cfg.gz.xxd < data/p1xbraten/master.cfg.gz gzip --keep --force --best --no-name data/p1xbraten/gamehud.cfg && xxd -i - data/p1xbraten/gamehud.cfg.gz.xxd < data/p1xbraten/gamehud.cfg.gz + gzip --keep --force --best --no-name data/p1xbraten/keymap.cfg && xxd -i - data/p1xbraten/keymap.cfg.gz.xxd < data/p1xbraten/keymap.cfg.gz -_include-menus: - sed -i "s/0,\/\/menuscrc/0x$(shell crc32 data/p1xbraten/menus.cfg),/" src/fpsgame/p1xbraten_cfgs.cpp - sed -i "s/embeddedfile<0> menuscfg/embeddedfile<$(shell stat --printf="%s" data/p1xbraten/menus.cfg.gz)> menuscfg/" src/fpsgame/p1xbraten_cfgs.cpp - sed -i "s/0,\/\/mastercrc/0x$(shell crc32 data/p1xbraten/master.cfg),/" src/fpsgame/p1xbraten_cfgs.cpp - sed -i "s/embeddedfile<0> mastercfg/embeddedfile<$(shell stat --printf="%s" data/p1xbraten/master.cfg.gz)> mastercfg/" src/fpsgame/p1xbraten_cfgs.cpp - sed -i "s/0,\/\/gamehudcrc/0x$(shell crc32 data/p1xbraten/gamehud.cfg),/" src/fpsgame/p1xbraten_cfgs.cpp - sed -i "s/embeddedfile<0> gamehudcfg/embeddedfile<$(shell stat --printf="%s" data/p1xbraten/gamehud.cfg.gz)> gamehudcfg/" src/fpsgame/p1xbraten_cfgs.cpp +embed-cfgs: gzip-cfgs + sed -i "s/0,\/\/menuscrc/0x$(shell crc32 data/p1xbraten/menus.cfg),/" src/fpsgame/embedded_cfgs.cpp + sed -i "s/embeddedfile<0> menuscfg/embeddedfile<$(shell stat --printf="%s" data/p1xbraten/menus.cfg.gz)> menuscfg/" src/fpsgame/embedded_cfgs.cpp + sed -i "s/0,\/\/mastercrc/0x$(shell crc32 data/p1xbraten/master.cfg),/" src/fpsgame/embedded_cfgs.cpp + sed -i "s/embeddedfile<0> mastercfg/embeddedfile<$(shell stat --printf="%s" data/p1xbraten/master.cfg.gz)> mastercfg/" src/fpsgame/embedded_cfgs.cpp + sed -i "s/0,\/\/gamehudcrc/0x$(shell crc32 data/p1xbraten/gamehud.cfg),/" src/fpsgame/embedded_cfgs.cpp + sed -i "s/embeddedfile<0> gamehudcfg/embeddedfile<$(shell stat --printf="%s" data/p1xbraten/gamehud.cfg.gz)> gamehudcfg/" src/fpsgame/embedded_cfgs.cpp + sed -i "s/0,\/\/keymapcrc/0x$(shell crc32 data/p1xbraten/keymap.cfg),/" src/fpsgame/embedded_cfgs.cpp + sed -i "s/embeddedfile<0> keymapcfg/embeddedfile<$(shell stat --printf="%s" data/p1xbraten/keymap.cfg.gz)> keymapcfg/" src/fpsgame/embedded_cfgs.cpp clean-sauer: check-env cd $(SAUER_DIR) && \ diff --git a/data/p1xbraten/keymap.cfg b/data/p1xbraten/keymap.cfg new file mode 100644 index 0000000..707ac7f --- /dev/null +++ b/data/p1xbraten/keymap.cfg @@ -0,0 +1,138 @@ +// do not modify, use "bind" in autoexec.cfg instead + +keymap -1 MOUSE1 +keymap -3 MOUSE2 +keymap -2 MOUSE3 +keymap -4 MOUSE4 +keymap -5 MOUSE5 +keymap -6 MOUSE6 +keymap -7 MOUSE7 +keymap -8 MOUSE8 +keymap -9 MOUSE9 +keymap -10 MOUSE10 +keymap -11 MOUSE11 +keymap -12 MOUSE12 +keymap 8 BACKSPACE +keymap 9 TAB +keymap 13 RETURN +keymap 27 ESCAPE +keymap 32 SPACE +keymap 33 EXCLAIM +keymap 34 QUOTEDBL +keymap 35 HASH +keymap 36 DOLLAR +keymap 38 AMPERSAND +keymap 39 QUOTE +keymap 40 LEFTPAREN +keymap 41 RIGHTPAREN +keymap 42 ASTERISK +keymap 43 PLUS +keymap 44 COMMA +keymap 45 MINUS +keymap 46 PERIOD +keymap 47 SLASH +keymap 48 0 +keymap 49 1 +keymap 50 2 +keymap 51 3 +keymap 52 4 +keymap 53 5 +keymap 54 6 +keymap 55 7 +keymap 56 8 +keymap 57 9 +keymap 58 COLON +keymap 59 SEMICOLON +keymap 60 LESS +keymap 61 EQUALS +keymap 62 GREATER +keymap 63 QUESTION +keymap 64 AT +keymap 91 LEFTBRACKET +keymap 92 BACKSLASH +keymap 93 RIGHTBRACKET +keymap 94 CARET +keymap 95 UNDERSCORE +keymap 96 BACKQUOTE +keymap 97 A +keymap 98 B +keymap 99 C +keymap 100 D +keymap 101 E +keymap 102 F +keymap 103 G +keymap 104 H +keymap 105 I +keymap 106 J +keymap 107 K +keymap 108 L +keymap 109 M +keymap 110 N +keymap 111 O +keymap 112 P +keymap 113 Q +keymap 114 R +keymap 115 S +keymap 116 T +keymap 117 U +keymap 118 V +keymap 119 W +keymap 120 X +keymap 121 Y +keymap 122 Z +keymap 127 DELETE +keymap 0x40000059 KP1 +keymap 0x4000005a KP2 +keymap 0x4000005b KP3 +keymap 0x4000005c KP4 +keymap 0x4000005d KP5 +keymap 0x4000005e KP6 +keymap 0x4000005f KP7 +keymap 0x40000060 KP8 +keymap 0x40000061 KP9 +keymap 0x40000062 KP0 +keymap 0x40000063 KP_PERIOD +keymap 0x40000054 KP_DIVIDE +keymap 0x40000055 KP_MULTIPLY +keymap 0x40000056 KP_MINUS +keymap 0x40000057 KP_PLUS +keymap 0x40000058 KP_ENTER +keymap 0x40000067 KP_EQUALS +keymap 0x40000052 UP +keymap 0x40000051 DOWN +keymap 0x4000004f RIGHT +keymap 0x40000050 LEFT +keymap 0x40000048 PAUSE +keymap 0x40000049 INSERT +keymap 0x4000004a HOME +keymap 0x4000004d END +keymap 0x4000004b PAGEUP +keymap 0x4000004e PAGEDOWN +keymap 0x4000003a F1 +keymap 0x4000003b F2 +keymap 0x4000003c F3 +keymap 0x4000003d F4 +keymap 0x4000003e F5 +keymap 0x4000003f F6 +keymap 0x40000040 F7 +keymap 0x40000041 F8 +keymap 0x40000042 F9 +keymap 0x40000043 F10 +keymap 0x40000044 F11 +keymap 0x40000045 F12 +keymap 0x40000053 NUMLOCK +keymap 0x40000039 CAPSLOCK +keymap 0x40000047 SCROLLOCK +keymap 0x400000e5 RSHIFT +keymap 0x400000e1 LSHIFT +keymap 0x400000e4 RCTRL +keymap 0x400000e0 LCTRL +keymap 0x400000e6 RALT +keymap 0x400000e2 LALT +keymap 0x400000e7 RMETA +keymap 0x400000e3 LMETA +keymap 0x40000065 COMPOSE +keymap 0x40000075 HELP +keymap 0x40000046 PRINT +keymap 0x4000009a SYSREQ +keymap 0x40000076 MENU diff --git a/data/p1xbraten/keymap.cfg.gz.xxd b/data/p1xbraten/keymap.cfg.gz.xxd new file mode 100644 index 0000000..5551617 --- /dev/null +++ b/data/p1xbraten/keymap.cfg.gz.xxd @@ -0,0 +1,71 @@ + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x6d, 0x96, + 0x5b, 0x6f, 0xdb, 0x38, 0x10, 0x85, 0xdf, 0xf3, 0x2b, 0x0e, 0xfa, 0xbc, + 0xdd, 0x4a, 0x22, 0x75, 0x7b, 0x64, 0x64, 0x2a, 0xd6, 0x9a, 0xba, 0x84, + 0x94, 0xda, 0x66, 0x5f, 0x0a, 0x27, 0x96, 0x17, 0xc1, 0xa2, 0xc9, 0x02, + 0x4d, 0x81, 0xf6, 0xdf, 0xef, 0xd8, 0x6a, 0x45, 0x26, 0x63, 0xbf, 0x9d, + 0x6f, 0x48, 0x6a, 0xc8, 0x39, 0xe4, 0xf8, 0xc3, 0x07, 0x1c, 0x9e, 0xf1, + 0xf4, 0xfc, 0x82, 0xaf, 0xcf, 0x87, 0xc7, 0xe3, 0xcf, 0x3f, 0xf0, 0xfd, + 0xdb, 0x8c, 0x77, 0xf7, 0x8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x50, 0x6e, 0xd4, 0xb6, 0x71, 0x3b, 0xcf, + 0x04, 0x06, 0x33, 0x39, 0xaf, 0x25, 0xaa, 0xbe, 0x6d, 0x95, 0x07, 0x54, + 0xb4, 0xa6, 0x0b, 0x47, 0x64, 0xa0, 0xa4, 0x9a, 0xde, 0xe7, 0x24, 0x73, + 0x38, 0x13, 0xee, 0x45, 0x16, 0x88, 0xbc, 0x28, 0xe1, 0x8d, 0x93, 0x46, + 0xf0, 0x9e, 0x49, 0x63, 0x78, 0xbb, 0xa4, 0x09, 0xbc, 0x53, 0x52, 0x01, + 0x6f, 0x92, 0x54, 0x22, 0xf3, 0x22, 0x45, 0xee, 0x45, 0x46, 0x45, 0x5c, + 0x45, 0x4e, 0xd5, 0x5b, 0x45, 0x41, 0xdb, 0x30, 0xbd, 0xdf, 0x7b, 0x5a, + 0xc2, 0xe9, 0xb6, 0x79, 0x0d, 0xb3, 0xd3, 0xd9, 0x39, 0xbf, 0xb5, 0x2c, + 0x86, 0xbe, 0x9d, 0x94, 0x09, 0x48, 0x82, 0x1b, 0xab, 0x15, 0x1d, 0x9a, + 0x47, 0x82, 0x2a, 0xa0, 0xdd, 0xd8, 0x84, 0x0b, 0x49, 0xa8, 0xd1, 0x9b, + 0x28, 0x3e, 0x97, 0xe4, 0xda, 0x92, 0xbd, 0x74, 0x80, 0x93, 0xc5, 0x70, + 0xaf, 0x8e, 0xaa, 0x14, 0x4b, 0xa5, 0xd8, 0x60, 0xaa, 0x03, 0x15, 0x2f, + 0x00, 0x29, 0xa6, 0x6e, 0x43, 0x6e, 0xa8, 0x7a, 0x1b, 0xf8, 0x35, 0x3b, + 0xaf, 0x79, 0xb6, 0xc4, 0xca, 0x72, 0xf8, 0xf2, 0x95, 0xe4, 0x72, 0x2f, + 0x4a, 0x54, 0xde, 0xdc, 0x51, 0x84, 0x4d, 0xa0, 0x68, 0xef, 0x81, 0x4a, + 0x50, 0x07, 0x4a, 0xe0, 0x26, 0x50, 0x12, 0xdb, 0x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0xe9, 0xd8, 0x87, 0xcb, 0x3d, 0xdc, 0x9d, 0xb3, 0xfa, 0x96, 0xad, 0x43, + 0xff, 0xea, 0x74, 0x37, 0x5d, 0xfd, 0x0f, 0x8e, 0x49, 0x3d, 0xdb, 0x75, + 0x0a, 0x00, 0x00 diff --git a/patches/include_p1xbraten_cfgs.patch b/patches/embedded_cfgs.patch similarity index 84% rename from patches/include_p1xbraten_cfgs.patch rename to patches/embedded_cfgs.patch index 1522c9a..07972d4 100644 --- a/patches/include_p1xbraten_cfgs.patch +++ b/patches/embedded_cfgs.patch @@ -6,7 +6,7 @@ Index: src/Makefile fpsgame/fps.o \ fpsgame/monster.o \ fpsgame/movable.o \ -+ fpsgame/p1xbraten_cfgs.o \ ++ fpsgame/embedded_cfgs.o \ fpsgame/render.o \ fpsgame/scoreboard.o \ fpsgame/server.o \ @@ -14,21 +14,24 @@ Index: src/engine/main.cpp =================================================================== --- src/engine/main.cpp (revision 6496) +++ src/engine/main.cpp (working copy) -@@ -1299,6 +1299,7 @@ - defformatstring(gamecfgname, "data/game_%s.cfg", game::gameident()); - execfile(gamecfgname); - if(game::savedservers()) execfile(game::savedservers(), false); -+ game::writep1xbratencfgs(); +@@ -1294,8 +1294,9 @@ + initsound(); - identflags |= IDF_PERSIST; - -Index: src/fpsgame/p1xbraten_cfgs.cpp + logoutf("init: cfg"); ++ game::writeembeddedcfgs(); + initing = INIT_LOAD; +- execfile("data/keymap.cfg"); ++ execfile("data/p1xbraten/keymap.cfg"); + execfile("data/stdedit.cfg"); + execfile("data/sounds.cfg"); + execfile("data/menus.cfg"); +Index: src/fpsgame/embedded_cfgs.cpp =================================================================== ---- src/fpsgame/p1xbraten_cfgs.cpp (nonexistent) -+++ src/fpsgame/p1xbraten_cfgs.cpp (working copy) -@@ -0,0 +1,66 @@ +--- src/fpsgame/embedded_cfgs.cpp (nonexistent) ++++ src/fpsgame/embedded_cfgs.cpp (working copy) +@@ -0,0 +1,77 @@ +#include "cube.h" -+#include "p1xbraten_cfgs.h" ++#include "embedded_cfgs.h" + +namespace game { + struct embeddedfile<0> menuscfg = { @@ -55,6 +58,14 @@ Index: src/fpsgame/p1xbraten_cfgs.cpp + } + }; + ++ struct embeddedfile<0> keymapcfg = { ++ "data/p1xbraten/keymap.cfg.gz", ++ 0,//keymapcrc ++ { ++ #include "../../data/p1xbraten/keymap.cfg.gz.xxd" ++ } ++ }; ++ + template + int update(embeddedfile *i) + { @@ -74,7 +85,7 @@ Index: src/fpsgame/p1xbraten_cfgs.cpp + return 0; + } + -+ int writep1xbratencfgs() ++ int writeembeddedcfgs() + { + int err = update(&menuscfg); + if(err) { conoutf("\f6error updating %s (error code %d)!", menuscfg.name, err); return err; } @@ -85,6 +96,9 @@ Index: src/fpsgame/p1xbraten_cfgs.cpp + err = update(&gamehudcfg); + if(err) { conoutf("\f6error updating %s(error code %d)!", gamehudcfg.name, err); return err; } + ++ err = update(&keymapcfg); ++ if(err) { conoutf("\f6error updating %s(error code %d)!", keymapcfg.name, err); return err; } ++ + return 0; + } + @@ -93,10 +107,10 @@ Index: src/fpsgame/p1xbraten_cfgs.cpp + else execfile("data/menus.cfg"); + }); +} -Index: src/fpsgame/p1xbraten_cfgs.h +Index: src/fpsgame/embedded_cfgs.h =================================================================== ---- src/fpsgame/p1xbraten_cfgs.h (nonexistent) -+++ src/fpsgame/p1xbraten_cfgs.h (working copy) +--- src/fpsgame/embedded_cfgs.h (nonexistent) ++++ src/fpsgame/embedded_cfgs.h (working copy) @@ -0,0 +1,10 @@ +#include "cube.h" + @@ -117,7 +131,7 @@ Index: src/shared/igame.h extern const char *autoexec(); extern const char *savedservers(); extern void loadconfigs(); -+ extern int writep1xbratencfgs(); ++ extern int writeembeddedcfgs(); extern void updateworld(); extern void initclient(); @@ -150,7 +164,7 @@ Index: src/vcpp/sauerbraten.vcxproj $(IntDir)%(Filename)2.obj $(IntDir)%(Filename)2.obj -+ ++ + cube.h + cube.h + $(IntDir)cube.pch diff --git a/src/Makefile b/src/Makefile index 240b517..4b09e9c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -129,7 +129,7 @@ CLIENT_OBJS= \ fpsgame/fragmessages.o \ fpsgame/monster.o \ fpsgame/movable.o \ - fpsgame/p1xbraten_cfgs.o \ + fpsgame/embedded_cfgs.o \ fpsgame/render.o \ fpsgame/scoreboard.o \ fpsgame/server.o \ @@ -529,13 +529,14 @@ fpsgame/movable.o: shared/ents.h shared/command.h shared/glexts.h fpsgame/movable.o: shared/glemu.h shared/iengine.h shared/igame.h fpsgame/movable.o: shared/authservers.h fpsgame/ai.h fpsgame/movable.o: fpsgame/weaponstats_type.h fpsgame/fragmessages.h -fpsgame/p1xbraten_cfgs.o: shared/cube.h shared/tools.h shared/geom.h -fpsgame/p1xbraten_cfgs.o: shared/ents.h shared/command.h shared/glexts.h -fpsgame/p1xbraten_cfgs.o: shared/glemu.h shared/iengine.h shared/igame.h -fpsgame/p1xbraten_cfgs.o: shared/authservers.h fpsgame/p1xbraten_cfgs.h -fpsgame/p1xbraten_cfgs.o: ../data/p1xbraten/menus.cfg.gz.xxd -fpsgame/p1xbraten_cfgs.o: ../data/p1xbraten/master.cfg.gz.xxd -fpsgame/p1xbraten_cfgs.o: ../data/p1xbraten/gamehud.cfg.gz.xxd +fpsgame/embedded_cfgs.o: shared/cube.h shared/tools.h shared/geom.h +fpsgame/embedded_cfgs.o: shared/ents.h shared/command.h shared/glexts.h +fpsgame/embedded_cfgs.o: shared/glemu.h shared/iengine.h shared/igame.h +fpsgame/embedded_cfgs.o: shared/authservers.h fpsgame/embedded_cfgs.h +fpsgame/embedded_cfgs.o: ../data/p1xbraten/menus.cfg.gz.xxd +fpsgame/embedded_cfgs.o: ../data/p1xbraten/master.cfg.gz.xxd +fpsgame/embedded_cfgs.o: ../data/p1xbraten/gamehud.cfg.gz.xxd +fpsgame/embedded_cfgs.o: ../data/p1xbraten/keymap.cfg.gz.xxd fpsgame/render.o: fpsgame/game.h shared/cube.h shared/tools.h shared/geom.h fpsgame/render.o: shared/ents.h shared/command.h shared/glexts.h fpsgame/render.o: shared/glemu.h shared/iengine.h shared/igame.h diff --git a/src/engine/main.cpp b/src/engine/main.cpp index a863abd..edb2343 100644 --- a/src/engine/main.cpp +++ b/src/engine/main.cpp @@ -1310,8 +1310,9 @@ int main(int argc, char **argv) initsound(); logoutf("init: cfg"); + game::writeembeddedcfgs(); initing = INIT_LOAD; - execfile("data/keymap.cfg"); + execfile("data/p1xbraten/keymap.cfg"); execfile("data/stdedit.cfg"); execfile("data/sounds.cfg"); execfile("data/menus.cfg"); @@ -1320,7 +1321,6 @@ int main(int argc, char **argv) defformatstring(gamecfgname, "data/game_%s.cfg", game::gameident()); execfile(gamecfgname); if(game::savedservers()) execfile(game::savedservers(), false); - game::writep1xbratencfgs(); execfile("data/p1xbraten/gamehud.cfg.gz"); identflags |= IDF_PERSIST; diff --git a/src/fpsgame/p1xbraten_cfgs.cpp b/src/fpsgame/embedded_cfgs.cpp similarity index 81% rename from src/fpsgame/p1xbraten_cfgs.cpp rename to src/fpsgame/embedded_cfgs.cpp index 274cf6d..90e5c8d 100644 --- a/src/fpsgame/p1xbraten_cfgs.cpp +++ b/src/fpsgame/embedded_cfgs.cpp @@ -1,5 +1,5 @@ #include "cube.h" -#include "p1xbraten_cfgs.h" +#include "embedded_cfgs.h" namespace game { struct embeddedfile<16060> menuscfg = { @@ -26,6 +26,14 @@ namespace game { } }; + struct embeddedfile<843> keymapcfg = { + "data/p1xbraten/keymap.cfg.gz", + 0xdb3d498e, + { + #include "../../data/p1xbraten/keymap.cfg.gz.xxd" + } + }; + template int update(embeddedfile *i) { @@ -45,7 +53,7 @@ namespace game { return 0; } - int writep1xbratencfgs() + int writeembeddedcfgs() { int err = update(&menuscfg); if(err) { conoutf("\f6error updating %s (error code %d)!", menuscfg.name, err); return err; } @@ -56,6 +64,9 @@ namespace game { err = update(&gamehudcfg); if(err) { conoutf("\f6error updating %s(error code %d)!", gamehudcfg.name, err); return err; } + err = update(&keymapcfg); + if(err) { conoutf("\f6error updating %s(error code %d)!", keymapcfg.name, err); return err; } + return 0; } diff --git a/src/fpsgame/p1xbraten_cfgs.h b/src/fpsgame/embedded_cfgs.h similarity index 100% rename from src/fpsgame/p1xbraten_cfgs.h rename to src/fpsgame/embedded_cfgs.h diff --git a/src/shared/igame.h b/src/shared/igame.h index af5ffac..5eeb248 100644 --- a/src/shared/igame.h +++ b/src/shared/igame.h @@ -48,7 +48,7 @@ namespace game extern const char *autoexec(); extern const char *savedservers(); extern void loadconfigs(); - extern int writep1xbratencfgs(); + extern int writeembeddedcfgs(); extern void updateworld(); extern void initclient(); diff --git a/src/vcpp/sauerbraten.vcxproj b/src/vcpp/sauerbraten.vcxproj index cf9553e..dbffba7 100644 --- a/src/vcpp/sauerbraten.vcxproj +++ b/src/vcpp/sauerbraten.vcxproj @@ -1156,7 +1156,7 @@ $(IntDir)%(Filename)2.obj $(IntDir)%(Filename)2.obj - + cube.h cube.h $(IntDir)cube.pch