introduces ios support? still needs metal

This commit is contained in:
2025-06-29 01:21:55 +03:00
parent af4f0c3cad
commit cdeaac7c0c
79 changed files with 2176 additions and 1349 deletions

View File

@@ -1,35 +0,0 @@
#include "god/build.h"
#include "god/c.h"
#include "god/ld.h"
char* client_dll = 0;
void client_build(struct build_data b)
{
char* files[] = {
"game/client/baseplayer.cpp",
NULL,
};
struct project p = {
.b = &b,
.files = files,
.name = "client",
};
struct project o = C_compile(p, (struct C_settings){
.generation_flags = C_GENERATION_FLAGS_PIC,
.compile_flags = C_COMPILE_FLAGS_WALL,
.include_dirs = include_dirs,
});
char* libs[] = {
"c",
NULL,
};
client_dll = ld_link_project(o, (struct link_settings){
.type = LINK_TYPE_DYNAMIC,
.libs = libs,
});
mv("build/"GAME_NAME"/game/"GAME_NAME"/bin/libclient.so",server_dll);
}

View File

@@ -18,15 +18,20 @@ int client_build()
compileProject.includeDirectories = all_IncludeDirectories;
compileProject.bFPIC = true;
ldProject = compileProject.Compile();
ldProject.linkType = ELINK_DYNAMIC_LIBRARY;
if (bStaticBuild)
ldProject.linkType = ELINK_STATIC_LIBRARY;
else
ldProject.linkType = ELINK_DYNAMIC_LIBRARY;
CUtlString outputProject = ldProject.Link();
const char *szGameName = ICommandLine::ParamValue("-game");
if (szGameName == NULL)
szGameName = "funnygame";
IFileSystem2::MakeDirectory(CUtlString("build/%s/game/%s/bin",szGameName, szGameName));
IFileSystem2::CopyFile(CUtlString("build/%s/game/%s/bin",szGameName,szGameName), outputProject);
if (!bStaticBuild)
{
IFileSystem2::MakeDirectory(CUtlString("%s/funnygame/bin",szOutputDir.GetString()));
IFileSystem2::CopyFile(CUtlString("%s/funnygame/bin", szOutputDir.GetString()), outputProject);
} else {
client_lib = outputProject;
}
return 0;
};

View File

@@ -1,6 +1,9 @@
#include "baseplayer.h"
#include "cglm/affine-pre.h"
#include "cglm/mat4.h"
#include "engine.h"
#include "rendering.h"
#include "input.h"
class C_MOBAPlayer: public C_BaseEntity
{
@@ -27,6 +30,13 @@ void C_MOBAPlayer::Destroy()
}
void C_MOBAPlayer::Think( float fDelta )
{
float x = g_fAxisValues[AXIS_MOUSE_X];
float y = g_fAxisValues[AXIS_MOUSE_Y];
float fPitch = glm_rad(x);
float fYaw = glm_rad(y);
glm_mat4_identity(g_cameraView);
glm_rotate_z(g_cameraView, fYaw, g_cameraView);
glm_rotate_y(g_cameraView, fPitch, g_cameraView);
if (g_localClient.pBasePlayer == pEntity)
{
g_cameraView[3][0] = pEntity->m_position[0];