Skip to content

Commit

Permalink
smoll edits here and there
Browse files Browse the repository at this point in the history
  • Loading branch information
BraXi committed Sep 12, 2024
1 parent 899f140 commit 7842605
Show file tree
Hide file tree
Showing 23 changed files with 203 additions and 170 deletions.
6 changes: 6 additions & 0 deletions src/common/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ See the attached GNU General Public License v2 for more details.
*/

// shared.h -- included first by ALL program modules

#ifndef _PRAGMA_SHARED_H_
#define _PRAGMA_SHARED_H_

#pragma once

#include "../engine/pragma_config.h"
Expand Down Expand Up @@ -691,5 +695,7 @@ typedef struct
short stats[MAX_STATS]; // fast status bar updates
} player_state_t;

#endif /*_PRAGMA_SHARED_H_*/



2 changes: 1 addition & 1 deletion src/engine/client/cgame/cg_entities.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ See the attached GNU General Public License v2 for more details.

#include "../client.h"
#include "cg_local.h"
#include "../../script/script_internals.h" // for ddef_t
#include "../../script/qcvm_private.h" // for ddef_t

extern ddef_t* Scr_FindEntityField(char* name); // scr_main.c
extern qboolean Scr_ParseEpair(void* base, ddef_t* key, char* s, int memtag); // scr_main.c
Expand Down
8 changes: 7 additions & 1 deletion src/engine/client/cgame/progdefs_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Copyright (C) 1997-2001 Id Software, Inc.
See the attached GNU General Public License v2 for more details.
*/

#ifndef _PRAGMA_PROGDEFS_CLIENT_H_
#define _PRAGMA_PROGDEFS_CLIENT_H_

#pragma once

#ifndef scr_func_t
typedef int32_t scr_func_t;
Expand Down Expand Up @@ -82,4 +86,6 @@ typedef struct cl_entvars_s
vec3_t color;

float fullbright;
} cl_entvars_t;
} cl_entvars_t;

#endif /*_PRAGMA_PROGDEFS_CLIENT_H_*/
2 changes: 1 addition & 1 deletion src/engine/client/ui/ui_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ See the attached GNU General Public License v2 for more details.
#pragma once

#include "../client.h"
#include "../../script/script_internals.h"
#include "../../script/qcvm_private.h"
#include "../../script/scriptvm.h"

#include "ui_local.h"
Expand Down
2 changes: 1 addition & 1 deletion src/engine/model_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ void Com_LoadAliasModel(cached_model_t* mod, void* buffer, const int filelen)
_strlwr(surf->name);

// strip off a trailing _1 or _2
j = strlen(surf->name);
j = (int)strlen(surf->name);
if (j > 2 && surf->name[j - 2] == '_')
{
surf->name[j - 2] = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/engine/pragma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,8 @@ void Qcommon_Init (int argc, char **argv)

printf("\n\n");

printf("running %i ticks per second\n", SERVER_FPS);
printf("protocol version is %i\n\n", PROTOCOL_VERSION);
printf("Server runs game at %i ticks per second.\n", SERVER_FPS);
printf("Protocol version is: %i.\n\n", PROTOCOL_VERSION);
#endif

if (setjmp (abortframe) )
Expand Down
11 changes: 6 additions & 5 deletions src/engine/pragma_dedsv.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<ClInclude Include="..\common\fileformats\smdl.h" />
<ClInclude Include="..\common\mathlib.h" />
<ClInclude Include="..\common\pragma_files.h" />
<ClInclude Include="..\common\shared.h" />
<ClInclude Include="client\cgame\progdefs_client.h" />
<ClInclude Include="cmd.h" />
<ClInclude Include="cmodel.h" />
Expand All @@ -46,7 +47,7 @@
<ClInclude Include="script\qc_opcodes.h" />
<ClInclude Include="script\qc_opnames.h" />
<ClInclude Include="script\scriptvm.h" />
<ClInclude Include="script\script_internals.h" />
<ClInclude Include="script\qcvm_private.h" />
<ClInclude Include="server\server.h" />
<ClInclude Include="server\sv_game.h" />
<ClInclude Include="sizebuf.h" />
Expand Down Expand Up @@ -74,10 +75,10 @@
<ClCompile Include="pragma.c" />
<ClCompile Include="script\scr_builtins_math.c" />
<ClCompile Include="script\scr_builtins_shared.c" />
<ClCompile Include="script\scr_debug.c" />
<ClCompile Include="script\scr_exec.c" />
<ClCompile Include="script\scr_main.c" />
<ClCompile Include="script\scr_utils.c" />
<ClCompile Include="script\qcvm_debug.c" />
<ClCompile Include="script\qcvm_exec.c" />
<ClCompile Include="script\qcvm_main.c" />
<ClCompile Include="script\qcvm_utils.c" />
<ClCompile Include="server\sv_ai.c" />
<ClCompile Include="server\sv_builtins.c" />
<ClCompile Include="server\sv_ccmds.c" />
Expand Down
13 changes: 8 additions & 5 deletions src/engine/pragma_dedsv.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<ClInclude Include="script\qc_opnames.h">
<Filter>QCVM</Filter>
</ClInclude>
<ClInclude Include="script\script_internals.h">
<ClInclude Include="script\qcvm_private.h">
<Filter>QCVM</Filter>
</ClInclude>
<ClInclude Include="script\scriptvm.h">
Expand Down Expand Up @@ -69,6 +69,9 @@
<ClInclude Include="..\common\crc.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\common\shared.h">
<Filter>Common</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\common\mathlib.c">
Expand All @@ -80,16 +83,16 @@
<ClCompile Include="script\scr_builtins_shared.c">
<Filter>QCVM</Filter>
</ClCompile>
<ClCompile Include="script\scr_debug.c">
<ClCompile Include="script\qcvm_debug.c">
<Filter>QCVM</Filter>
</ClCompile>
<ClCompile Include="script\scr_exec.c">
<ClCompile Include="script\qcvm_exec.c">
<Filter>QCVM</Filter>
</ClCompile>
<ClCompile Include="script\scr_main.c">
<ClCompile Include="script\qcvm_main.c">
<Filter>QCVM</Filter>
</ClCompile>
<ClCompile Include="script\scr_utils.c">
<ClCompile Include="script\qcvm_utils.c">
<Filter>QCVM</Filter>
</ClCompile>
<ClCompile Include="client\cgame\cg_builtins.c">
Expand Down
10 changes: 5 additions & 5 deletions src/engine/pragma_engine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<ClInclude Include="script\qc_opcodes.h" />
<ClInclude Include="script\qc_opnames.h" />
<ClInclude Include="script\scriptvm.h" />
<ClInclude Include="script\script_internals.h" />
<ClInclude Include="script\qcvm_private.h" />
<ClInclude Include="server\server.h" />
<ClInclude Include="server\sv_game.h" />
<ClInclude Include="usercmd.h" />
Expand Down Expand Up @@ -125,10 +125,10 @@
<ClCompile Include="net_chan.c" />
<ClCompile Include="..\common\shared.c" />
<ClCompile Include="script\scr_builtins_math.c" />
<ClCompile Include="script\scr_debug.c" />
<ClCompile Include="script\scr_exec.c" />
<ClCompile Include="script\scr_main.c" />
<ClCompile Include="script\scr_utils.c" />
<ClCompile Include="script\qcvm_debug.c" />
<ClCompile Include="script\qcvm_exec.c" />
<ClCompile Include="script\qcvm_main.c" />
<ClCompile Include="script\qcvm_utils.c" />
<ClCompile Include="server\sv_ai.c" />
<ClCompile Include="server\sv_devtools.c" />
<ClCompile Include="server\sv_load.c" />
Expand Down
22 changes: 11 additions & 11 deletions src/engine/pragma_engine.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,16 @@
<ClCompile Include="script\scr_builtins_shared.c">
<Filter>QCVM</Filter>
</ClCompile>
<ClCompile Include="script\scr_debug.c">
<ClCompile Include="script\qcvm_debug.c">
<Filter>QCVM</Filter>
</ClCompile>
<ClCompile Include="script\scr_exec.c">
<ClCompile Include="script\qcvm_exec.c">
<Filter>QCVM</Filter>
</ClCompile>
<ClCompile Include="script\scr_main.c">
<ClCompile Include="script\qcvm_main.c">
<Filter>QCVM</Filter>
</ClCompile>
<ClCompile Include="script\scr_utils.c">
<ClCompile Include="script\qcvm_utils.c">
<Filter>QCVM</Filter>
</ClCompile>
<ClCompile Include="..\common\mathlib.c">
Expand Down Expand Up @@ -282,27 +282,27 @@
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\common\fileformats\bsp.h">
<Filter>QCVM\File Formats</Filter>
<Filter>Common\File Formats</Filter>
</ClInclude>
<ClInclude Include="..\common\fileformats\md3.h">
<Filter>QCVM\File Formats</Filter>
<Filter>Common\File Formats</Filter>
</ClInclude>
<ClInclude Include="..\common\fileformats\pak.h">
<Filter>QCVM\File Formats</Filter>
<Filter>Common\File Formats</Filter>
</ClInclude>
<ClInclude Include="..\common\fileformats\pmodel.h">
<Filter>QCVM\File Formats</Filter>
<Filter>Common\File Formats</Filter>
</ClInclude>
<ClInclude Include="..\common\fileformats\smdl.h">
<Filter>QCVM\File Formats</Filter>
<Filter>Common\File Formats</Filter>
</ClInclude>
<ClInclude Include="script\qc_opcodes.h">
<Filter>QCVM</Filter>
</ClInclude>
<ClInclude Include="script\qc_opnames.h">
<Filter>QCVM</Filter>
</ClInclude>
<ClInclude Include="script\script_internals.h">
<ClInclude Include="script\qcvm_private.h">
<Filter>QCVM</Filter>
</ClInclude>
<ClInclude Include="script\scriptvm.h">
Expand Down Expand Up @@ -355,7 +355,7 @@
<Filter Include="Client\GUI">
<UniqueIdentifier>{a6d0833b-ce91-4759-8fce-f26ba289128f}</UniqueIdentifier>
</Filter>
<Filter Include="QCVM\File Formats">
<Filter Include="Common\File Formats">
<UniqueIdentifier>{87710d39-a80c-4ea4-ad15-187203329dd9}</UniqueIdentifier>
</Filter>
</ItemGroup>
Expand Down
13 changes: 6 additions & 7 deletions src/engine/script/progdefs_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ Copyright (C) 1997-2001 Id Software, Inc.
See the attached GNU General Public License v2 for more details.
*/

#ifndef _PRAGMA_PROGDEFS_SERVER_H_
#define _PRAGMA_PROGDEFS_SERVER_H_

#ifndef scr_func_t
typedef int32_t scr_func_t;
typedef int32_t scr_entity_t;
typedef int32_t scr_string_t;
#endif

#pragma once

// prog globals
typedef struct sv_globalvars_s
Expand Down Expand Up @@ -155,4 +152,6 @@ typedef struct sv_entvars_s
int32_t pm_gravity;
vec3_t pm_delta_angles; // add to command angles to get view direction
// changed by spawns, rotating objects, and teleporters
} sv_entvars_t;
} sv_entvars_t;

#endif
19 changes: 13 additions & 6 deletions src/engine/script/progdefs_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ Copyright (C) 1997-2001 Id Software, Inc.
See the attached GNU General Public License v2 for more details.
*/

#ifndef _PRAGMA_PROGDEFS_GUI_H_
#define _PRAGMA_PROGDEFS_GUI_H_

#pragma once

#ifndef scr_func_t
typedef int32_t scr_func_t;
typedef int32_t scr_int_t;
// typedef vec3_t scr_vec_t;
typedef int32_t scr_entity_t;
typedef int32_t scr_string_t;
typedef int32_t scr_func_t;
typedef int32_t scr_int_t;
// typedef vec3_t scr_vec_t;
typedef int32_t scr_entity_t;
typedef int32_t scr_string_t;
#endif

typedef struct ui_globalvars_s
Expand Down Expand Up @@ -56,4 +61,6 @@ typedef struct ui_itemvars_s
// also "rgba"
vec3_t color;
float alpha;
} ui_itemvars_t;
} ui_itemvars_t;

#endif /*_PRAGMA_PROGDEFS_GUI_H_*/
26 changes: 13 additions & 13 deletions src/engine/script/scr_debug.c → src/engine/script/qcvm_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See the attached GNU General Public License v2 for more details.
// scr_debug.c

#include "../pragma.h"
#include "script_internals.h"
#include "qcvm_private.h"


static int type_size[9] =
Expand Down Expand Up @@ -73,18 +73,18 @@ char* Scr_ValueString(etype_t type, eval_t* val)
switch (type)
{
case ev_string:
sprintf(line, "%s", ScrInternal_String(val->string));
sprintf(line, "%s", Scr_GetString(val->string));
break;
case ev_entity:
sprintf(line, "entity %i", (int)NUM_FOR_ENT(VM_TO_ENT(val->edict)));
break;
case ev_function:
f = active_qcvm->functions + val->function;
sprintf(line, "%s()", ScrInternal_String(f->s_name));
sprintf(line, "%s()", Scr_GetString(f->s_name));
break;
case ev_field:
def = ScrInternal_FieldAtOfs(val->_int);
sprintf(line, ".%s", ScrInternal_String(def->s_name));
sprintf(line, ".%s", Scr_GetString(def->s_name));
break;
case ev_void:
sprintf(line, "*void*");
Expand Down Expand Up @@ -130,18 +130,18 @@ char* Scr_ValueStringDeveloper(etype_t type, eval_t* val)
switch (type)
{
case ev_string:
sprintf(line, "'%s' [string]", ScrInternal_String(val->string));
sprintf(line, "'%s' [string]", Scr_GetString(val->string));
break;
case ev_entity:
sprintf(line, "%i [entity]", (int)NUM_FOR_ENT(VM_TO_ENT(val->edict)));
break;
case ev_function:
f = active_qcvm->functions + val->function;
sprintf(line, "%s [function]", ScrInternal_String(f->s_name));
sprintf(line, "%s [function]", Scr_GetString(f->s_name));
break;
case ev_field:
def = ScrInternal_FieldAtOfs(val->_int);
sprintf(line, "%s [field]", ScrInternal_String(def->s_name));
sprintf(line, "%s [field]", Scr_GetString(def->s_name));
break;
case ev_void:
sprintf(line, "*void*");
Expand Down Expand Up @@ -184,18 +184,18 @@ char* Scr_UglyValueString(etype_t type, eval_t* val)
switch (type)
{
case ev_string:
sprintf(line, "%s", ScrInternal_String(val->string));
sprintf(line, "%s", Scr_GetString(val->string));
break;
case ev_entity:
//sprintf(line, "%i", NUM_FOR_EDICT(PROG_TO_GENT(val->edict))); // braxi -- fixme
break;
case ev_function:
f = active_qcvm->functions + val->function;
sprintf(line, "%s", ScrInternal_String(f->s_name));
sprintf(line, "%s", Scr_GetString(f->s_name));
break;
case ev_field:
def = ScrInternal_FieldAtOfs(val->_int);
sprintf(line, "%s", ScrInternal_String(def->s_name));
sprintf(line, "%s", Scr_GetString(def->s_name));
break;
case ev_void:
sprintf(line, "void");
Expand Down Expand Up @@ -245,7 +245,7 @@ char* Scr_GlobalString(int ofs)
else
{
s = Scr_ValueString(def->type, val);
sprintf(line, "%i(%s)%s", ofs, ScrInternal_String(def->s_name), s);
sprintf(line, "%i(%s)%s", ofs, Scr_GetString(def->s_name), s);
}

i = (int)strlen(line);
Expand All @@ -267,7 +267,7 @@ char* Scr_GlobalStringNoContents(int ofs)
if (!def)
sprintf(line, "%i(???)", ofs);
else
sprintf(line, "%i(%s)", ofs, ScrInternal_String(def->s_name));
sprintf(line, "%i(%s)", ofs, Scr_GetString(def->s_name));

i = (int)strlen(line);
for (; i < 20; i++)
Expand Down Expand Up @@ -356,7 +356,7 @@ void Scr_StackTrace()
Com_Printf("%i: <NO FUNCTION>\n", i);
}
else
Com_Printf("%i: %s : %s\n", i, ScrInternal_String(f->s_file), ScrInternal_String(f->s_name));
Com_Printf("%i: %s : %s\n", i, Scr_GetString(f->s_file), Scr_GetString(f->s_name));
}
}

Expand Down
Loading

0 comments on commit 7842605

Please sign in to comment.