Skip to content

Commit

Permalink
Merge pull request #44 from Subject9x/beta-2-post-dev
Browse files Browse the repository at this point in the history
will tag as a minor release too.
  • Loading branch information
Subject9x authored Oct 11, 2020
2 parents 6d960b7 + 6d6bbda commit 4c7a766
Show file tree
Hide file tree
Showing 126 changed files with 3,411 additions and 2,435 deletions.
97 changes: 50 additions & 47 deletions client/client_main.qc
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ void() CSQC_Init =
loadfont("Roboto-Light", "gfx/fonts/Roboto_Light", "6 8 10 12 16", FONT_DEFAULT, TRUE, FALSE);
loadfont("Roboto_Regular", "gfx/fonts/Roboto_Regular", "6 8 10 12 16", FONT_CONSOLE, TRUE, FALSE);

SCOREBOARDMAX = maxclients;
SCORESTACK = 0;

for( i=0; i < SCOREBOARDMAX; i=i+1){
SCOREBOARD[i] = 0;
SCORETABLE[i] = 0;
SCOREBOARD[i] = -1;
}
scoreboard_think();

cl_set_hud_vars_obs();

Expand Down Expand Up @@ -293,14 +295,6 @@ void(float w, float h, float menushown) CSQC_UpdateView =
setproperty(VF_FOG_FADEDEPTH, FOG_FADE_DEPTH);

// add any polygons we want here

//DATA - Update local Client data vars from Server

client_get_info();

receive_ent_bindData();

client_state_events();
makevectors(input_angles);
//=================================================

Expand Down Expand Up @@ -334,7 +328,13 @@ void(float w, float h, float menushown) CSQC_UpdateView =
addentities( (MASK_ENGINE | MASK_ENGINEVIEWMODELS) );
renderscene();
}


//DATA - Update local Client data vars from Server
//note - make sure this is called AFTER addentities(), hehe
client_get_info();
receive_ent_bindData();
client_state_events();

/*
special rant: the fact that the client itself, isn't a faffing global entity in the CLIENT
module of all things is the height of idiocy.
Expand Down Expand Up @@ -387,11 +387,10 @@ void(float w, float h, float menushown) CSQC_UpdateView =
porg_x = pang_x = torg_x = VIEW_ORG_x;
porg_y = pang_y = torg_y = VIEW_MAX_y;
drawstring(porg + gui_percentToPixelRawVec('1 -30'), strcat("Player Origin: ", vtos(getpropertyvec(VF_ORIGIN))), '8 8 0', '0.85 0.85 0.85', 1, 0);
//version wille eventually be only displayed as needed.
gui_drawversion();
}

//FIXME / TODO / DEBUG
//version wille eventually be only displayed as needed.
gui_drawversion();
};

// called on all console commands, but be sure to registercmd() first so the tab completion works!
Expand Down Expand Up @@ -566,7 +565,10 @@ float(float event) CSQC_Event =
// OPTIONAL, probably should be deprecated as well
entity(float entNum) CSQC_Ent_Spawn =
{
return spawn();
local entity e;
e = spawn();
e.entnum = entNum;
return e;
};


Expand All @@ -581,15 +583,27 @@ void(float isnew) CSQC_Ent_Update =
sendent_handle_update( isnew );
};

// called when a network slot is emptied, you may choose to remove(self) or not
//
/*
called when a network slot is emptied, you may choose to remove(self) or not - Darkplaces
context: CSQC DOES NOT know the 'why' behind calling the Remove() function, but its important
to know the 2 main 'whys'.
1) Entity was removed/deallocated from the Server, ie SSQC.remove(entity);
2) Entity fell out of client's view scope, and no longer visible to client.
knowing these 2 cases makes all the difference about executing this function.
*/
void() CSQC_Ent_Remove ={
local entity weps;
local entity next;
local entity rem;

self.entnum = 0; //clears out old reference, must have!

if( (self.flags & FL_CLIENT) ){
if(self.t_remove){
if(self.t_remove()){
if(!self.t_remove()){
remove(self);
}
}
Expand All @@ -598,63 +612,52 @@ void() CSQC_Ent_Remove ={
}
}
else{
if( self.data_type == DATA_VEHC || self.data_type == DATA_MECH ){
if( self.data_type == DATA_VEHC || self.data_type == DATA_MECH || self.data_type == DATA_BLD ){
weps = self.w_slot;
while( weps.data_idx ){
while( weps ){
next = weps.w_slot;
rem = weps;
weps = next;
if( rem ){
if( rem.owner == self ){
remove(rem);
}
}
if( self.torsoCenter ){
if( self.torsoCenter.owner == self ){
remove(self.torsoCenter);
}
if( self.torsoLeft ){
if( self.torsoLeft.owner == self ){
remove(self.torsoLeft);
}
if( self.torsoRight ){
if( self.torsoRight.owner == self ){
remove(self.torsoRight);
}
if( self.armLeft ){
if( self.armLeft.owner == self ){
remove(self.armLeft);
}
if( self.armRight ){
if( self.armRight.owner == self ){
remove( self.armRight);
}
if( self.legs ){
if( self.legs.owner == self ){
remove(self.legs );
}
}
if( self.data_type == DATA_BLD ){
weps = self.w_slot;
while( weps.data_idx ){
next = weps.w_slot;
rem = weps;
weps = next;
if( rem ){
remove(rem);
}
}
if( self.torsoCenter ){
remove(self.torsoCenter);
}
if( self.effect1 ){
remove(self.effect1);
if( self.effect1.owner == self ){
remove(self.effect1 );
}
if( self.effect2 ){
remove(self.effect2);
if( self.effect2.owner == self ){
remove(self.effect2 );
}
if( self.effect3 ){
remove(self.effect3);
if( self.effect3.owner == self ){
remove(self.effect3 );
}
}
if(self.netname != "" ){
strunzone(self.netname);
}
remove(self);
}
if( wasfreed(self) ){
return;
}
remove(self);
};

// called when cl_cmd is used in the console (much like menu_cmd and sv_cmd for menu.dat and progs.dat), can perform special logic or useful functionality (like bestweapon)
Expand Down
1 change: 0 additions & 1 deletion client/data/client_precache.qc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ void() cs_precache={
UI_DEF_REC_64 = precache_pic("gfx/ui/box_64_rec.png",8);
UI_BTN_ARR_RIGHT = precache_pic("gfx/ui/btn_arr_right.png",8);
UI_BTN_ARR_LEFT = precache_pic("gfx/ui/btn_arr_left.png",8);
UI_COMPASS = precache_pic("gfx/ui/ui_compass.png",8);
HUD_TARGET_BOX = precache_pic("gfx/hud/target_box.png",0);

HUD_TARGET_BOX_TL = precache_pic("gfx/hud/target_box_tl.png",0);
Expand Down
3 changes: 2 additions & 1 deletion client/data/data_buildings.qc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Overview:
self is building
*/
void( float dataID ) data_sync_new_building={
self.solid = SOLID_BBOX;

self.solid = SOLID_SLIDEBOX;
switch(dataID){
case UI_BUILDING_radar:
data_building_radar();
Expand Down
9 changes: 7 additions & 2 deletions client/data/data_mech.qc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void( float dataID ) data_sync_new_mech_ai={
if( self.legs ){
data_mech_setup_part( self.legs );
}

self.deadflag = DEAD_NO;
self.critBits = 0;
maxSave = self.maxs;
Expand All @@ -53,7 +54,12 @@ void( float dataID ) data_sync_new_mech_ai={
setsize(self, minSave, maxSave);
sendent_ini_interpolate();
sendent_setup_weapons();
self.solid = SOLID_BBOX;
if( (self.flags & FL_CLIENT) ){
self.solid = SOLID_BBOX;
}
else{
self.solid = SOLID_SLIDEBOX;
}
};

void( entity setPart ) data_mech_setup_part={
Expand All @@ -62,5 +68,4 @@ void( entity setPart ) data_mech_setup_part={
setPart.origin = self.origin + (v_right * setPart.compOffset_x) + (v_forward * setPart.compOffset_z) + (v_up * setPart.compOffset_y);
setPart.angles = self.angles;
setorigin(setPart, setPart.origin);
setPart.drawmask = MASK_ENGINE;
};
12 changes: 5 additions & 7 deletions client/data/data_projectiles.qc
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ void( float dataID ) data_sync_new_projectile={
};

float() predraw_missile={
if( wasfreed(self) ){
return FALSE;
}

interpolate_origin();
setorigin(self, self.origin);
interpolate_angle();

if( self.predraw_projectile ){
Expand All @@ -63,13 +58,15 @@ float() predraw_missile={
};

float() predraw_plasma={
local float tScale;
if( self.impactType == IMPACT_ARMOR ){
self.alpha = 0.33;
self.scale = 0.33;
}
else{
self.scale = self.scale + 0.075;
self.alpha = self.alpha - 0.025;
tScale = self.scale;
self.scale = tScale + ((tScale + 0.005) - tScale)*self.lerpfrac;
self.alpha = self.alpha + ((self.alpha - 0.005) - self.alpha)*self.lerpfrac;
}
return FALSE;
};
Expand All @@ -79,6 +76,7 @@ float() predraw_marh={
cluster = self.w_slot;
makevectors(self.angles);
while( cluster != world ){
addentity(cluster);
cluster.origin = self.origin + (v_forward * cluster.compOffset_z) + (v_right * cluster.compOffset_x) + (v_up * cluster.compOffset_y);
if( cluster.traileffectnum != 0 && cluster.origin2 != '0 0 0' ){
trailparticles(cluster, cluster.traileffectnum, cluster.origin2, cluster.origin);
Expand Down
6 changes: 3 additions & 3 deletions client/data/data_system.qc
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ void(float vec_id) initialize_data_turret_={

void(float wep_id) initialize_data_item_={
switch(wep_id){
default:
data_ini_empty_weapon_();
break;
case UID_ITEM_light_autocannon:
data_ini_light_atc_();
break;
Expand Down Expand Up @@ -146,6 +143,9 @@ void(float wep_id) initialize_data_item_={
case UID_ITEM_turbo_charger:
data_ini_equip_turbo_charger_();
break;
default:
data_ini_empty_weapon_();
break;
}
};

Expand Down
72 changes: 20 additions & 52 deletions client/data/data_turrets.qc
Original file line number Diff line number Diff line change
Expand Up @@ -14,69 +14,37 @@ Overview:
void( float dataID ) data_sync_new_turret={
self.flags = FL_MONSTER | FL_UNIT;
self.solid = SOLID_BBOX;

weaponList = self; //prepare to build unit's weapon list
self.hardpoint_cnt = 0;

self.data_type = DATA_BLD;
self.colormod = '1 1 1';
setorigin( self, self.origin );

switch( dataID ){
case UID_TURRET_light_turret:
data_turret_light();
data_ini_light_turret_();
self.vec_size = 1;
break;

case UID_TURRET_missile_turret:
data_turret_missile();
data_ini_missile_turret_();
self.vec_size = 2;
break;

case UID_TURRET_heavy_turret:
data_turret_heavy();
data_ini_heavy_turret_();
self.vec_size = 3;
break;
}

}

void() data_turret_light={
local vector offset;

data_ini_light_turret_();

setmodel(self, self.model);

self.torsoCenter.drawmask = MASK_ENGINE;
setmodel(self.torsoCenter, self.torsoCenter.model);

makevectors(self.angles);
offset = self.origin + (v_up * self.torsoCenter.compOffset_y);
setsize(self, self.mins, self.maxs);
setorigin(self.torsoCenter, offset);
self.vec_size = 1;
};

void() data_turret_heavy={
local vector offset;

data_ini_heavy_turret_();

setmodel(self, self.model);

self.torsoCenter.drawmask = MASK_ENGINE;
setmodel(self.torsoCenter, self.torsoCenter.model);

makevectors(self.angles);
offset = self.origin + (v_up * self.torsoCenter.compOffset_y);
setsize(self, self.mins, self.maxs);
setorigin(self.torsoCenter, offset);
self.vec_size = 2;
};

void() data_turret_missile={
local vector offset;

data_ini_missile_turret_();
data_mech_setup_part(self.torsoCenter);

setmodel(self, self.model);

self.torsoCenter.drawmask = MASK_ENGINE;
setmodel(self.torsoCenter, self.torsoCenter.model);

makevectors(self.angles);
offset = self.origin + (v_up * self.torsoCenter.compOffset_y);
setsize(self, self.mins, self.maxs);
setorigin(self.torsoCenter, offset);
self.vec_size = 2;
};
sendent_setup_weapons();
sendent_ini_interpolate();
self.takedamage = DAMAGE_AIM;
self.interpolate_entity = interpolate_turret;
}
Loading

0 comments on commit 4c7a766

Please sign in to comment.