sudo apt install build-essential cargo cmake git glslang-tools google-mock libavcodec-extra libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libcurl4-openssl-dev libfreetype6-dev libglew-dev libnotify-dev libogg-dev libopus-dev libopusfile-dev libpng-dev libsdl2-dev libsqlite3-dev libssl-dev libvulkan-dev libwavpack-dev libx264-dev python rustc spirv-tools
lf
select the folders/files you want and it opens them up in your text editor and I rename them from there :). And since I use vis
which has mutliple cursors renaming stuff is very easy ;).vidir
from moreutils
static float OldUpdateTime = Client()->LocalTime();
if (OldUpdateTime + 5 < Client()->LocalTime())
{
OldUpdateTime = Client()->LocalTime();
IDiscord *discord = Kernel()->RequestInterface<IDiscord>();
int LocalID = m_aLocalIDs[g_Config.m_ClDummy];
bool Afk = m_aClients[LocalID].m_Afk;
if(!discord)
return;
const char *pText;
const char *pImage;
if(Afk)
{
pText = "Idleing...";
pImage = "idle";
}
else if(Client()->State() != IClient::STATE_ONLINE)
{
pText = "Chilling in menus";
pImage = "menu";
}
else
{
pText = "Playing";
pImage = "greenline";
}
discord->SetGameInfo(Client()->ServerAddress(), Client()->GetCurrentMap(), false, pText, pImage);
}
pub trait ValueDeserializer<'a, TType, TLibfunc>
where
Self: for<'de> DeserializeSeed<'de, Value = NonNull<()>>,
TType: GenericType,
TLibfunc: GenericLibfunc,
{
fn new(
arena: &'a Bump,
registry: &'a ProgramRegistry<TType, TLibfunc>,
info: &'a <TType as GenericType>::Concrete,
) -> Self;
}
FILE *f = fopen(pathname, "r")
but when I execute the program it's relative to the path I execute it from. Is there a way for it to be absolute. (btw the pathname is "data/shaders"
)FILE *f = fopen(pathname, "r")
but when I execute the program it's relative to the path I execute it from. Is there a way for it to be absolute. (btw the pathname is "data/shaders"
) void
gettargetdir(char *dirbuf, char *argv0) {
size_t off;
char *ls; /* last slash '/' */
if (!(ls = strrchr(argv0))) {
strcpy(dirbuf, ".");
return;
}
off = ls - argv0;
strncpy(dirbuf, argv0, off);
dirbuf[off] = '\0';
}
int main(int argc, char *argv[]) {
char targetdir[PATH_MAX];
gettargetdir(targetdir, argv[0]);
chdir(targetdir);
}
@Mr.Gh0s7 (edited)argv[0]
couldn't be used only if it is intentionally invalidvoid
gettargetdir(char *dirbuf, char *argv0) {
size_t off;
char *ls; /* last slash '/' */
if (!(ls = strrchr(argv0))) {
strcpy(dirbuf, ".");
return;
}
off = ls - argv0;
strncpy(dirbuf, argv0, off);
dirbuf[off] = '\0';
}
int main(int argc, char *argv[]) {
char targetdir[PATH_MAX];
gettargetdir(targetdir, argv[0]);
chdir(targetdir);
}
@Mr.Gh0s7 (edited)less
so I can see variable names etc directly, I don't use memory for everything.less
so I can see variable names etc directly, I don't use memory for everything. lf
is in Go and has Windows supportvariables
andconfig_variables
variables
andconfig_variables
C:\Users\storm\CLionProjects\StormAcl\src\././game/variables.h(8,1): fatal error C1189: #error: "The config macros must be defined" [C:\Users\storm\CLionProjects\StormAcl\cmake-build-debug-visual-studio\game-client.vcxproj
serde_json::json!()
void str_append(char *dst, const char *src, int dst_size)
{
int s = str_length(dst);
int i = 0;
while(s < dst_size)
{
dst[s] = src[i];
if(!src[i]) /* check for null termination */
break;
s++;
i++;
}
dst[dst_size - 1] = 0; /* assure null termination */
str_utf8_fix_truncation(dst);
}
someone have an idea what happen lmao (edited)nullptr
str_append(aBuf, nullptr, sizeof(aBuf))
, it'll likely crash right theresrc
src/engine/shared/storage.cpp(764): Type invalid
SCLIENT_RELEASE_VERSION
below the #endif
size_t
with %d
formatsize_t
are basically broke for translated texts because PRIzu
is defined as different strings depending on compilersize_t
in any localized text though, and casing to int
fixes it for most cases anywayint
I guessAllow client to still save settings that it doesn't know about.
from #6660. Previously if you were to use a different client such as Tater-Client which shares the same config file as DDNet, the settings used from Tater-Client would be lost if you were to launch up DDNet again.
More attributes!
section it add color to the vertices array which I am not particulary fond of. Instead I made another array named colorsOfVertices and created GLuint VBOs[2]
and then glBindBuffer(GL_ARRAY_BUFFER, VBOs[0]);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, VBOs[1]);
glBufferData(GL_ARRAY_BUFFER, sizeof(colorsOfVertices), colorsOfVertices, GL_STATIC_DRAW);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0);
glEnableVertexAttribArray(1);
instead of glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)(3* sizeof(float)));
glEnableVertexAttribArray(1);
%zu
was added at VS 2013, but MinGW doesn't?More attributes!
section it add color to the vertices array which I am not particulary fond of. Instead I made another array named colorsOfVertices and created GLuint VBOs[2]
and then glBindBuffer(GL_ARRAY_BUFFER, VBOs[0]);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, VBOs[1]);
glBufferData(GL_ARRAY_BUFFER, sizeof(colorsOfVertices), colorsOfVertices, GL_STATIC_DRAW);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0);
glEnableVertexAttribArray(1);
instead of glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)(3* sizeof(float)));
glEnableVertexAttribArray(1);
Row.HMargin(2.0f, &Row);
Row.VSplitLeft(Width, &Button, &Row);
Button.VSplitLeft((Width - Button.h) / 4.0f, nullptr, &Button);
Button.VSplitLeft(Button.h, &Button, nullptr);
if(g_Config.m_ClShowChatFriends && !CurrentClient.m_Friend)
DoButton_Toggle(&s_aPlayerIDs[Index][0], 1, &Button, false);
else if(DoButton_Toggle(&s_aPlayerIDs[Index][0], CurrentClient.m_Foe, &Button, true))
CurrentClient.m_Foe ^= 1;