Skip to content

Commit 9e4adce

Browse files
committed
Half-Life SDK 1.0 (SP)
0 parents  commit 9e4adce

File tree

190 files changed

+103108
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+103108
-0
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*.reg text eol=crlf
2+
*.ps1 text eol=crlf
3+
*.cmd text eol=crlf
4+
*.bat text eol=crlf
5+
*.dsp text eol=crlf
6+
*.dsw text eol=crlf
7+
*.sln text eol=crlf
8+
*.vcproj text eol=crlf
9+
*.vcxproj text eol=crlf
10+
*.vcxproj.filters text eol=crlf
11+
12+
*.sh text eol=lf

MIRRORS.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Mirrors
2+
3+
## ~ Shared ~
4+
5+
### HLSDK 2.3 (Source code):
6+
7+
- https://code.idtech.space/valve/halflife-sdk/releases/download/v2.3/hl_sdk_v23_source.exe
8+
- http://metamod.org/files/sdk/old/hl_sdk_v23_source.exe
9+
10+
### HLSDK 2.3 (Full):
11+
12+
- https://valvearchive.com/archive/Half-Life/Half-Life/SDK%20Releases/SDK%202.3/hl_sdk_v23.exe
13+
14+
### HLSDK (GitHub):
15+
16+
- https://github.com/ValveSoftware/halflife
17+
18+
## ~ Singleplayer ~
19+
20+
### HLSDK 1.0, 2.0:
21+
22+
- https://valvearchive.com/archive/Half-Life/Half-Life/SDK%20Releases/SDK%202.1/fullsdk.EXE
23+
24+
### HLSDK 2.2 (Source code):
25+
26+
- https://code.idtech.space/valve/halflife-sdk/releases/download/v2.2/HL_Full_SDK_2_2_Source.zip
27+
- http://metamod.org/files/sdk/old/HL_Full_SDK_2_2_Source.zip
28+
29+
### HLSDK 2.2 (Full):
30+
31+
- https://valvearchive.com/archive/Half-Life/Half-Life/SDK%20Releases/SDK%202.2/HL_Full_SDK_2_2.exe
32+
- http://metamod.org/files/sdk/old/HL_Full_SDK_2_2.exe
33+
34+
## ~ Multiplayer ~
35+
36+
### HLSDK 1.0, 2.0:
37+
38+
- https://code.idtech.space/valve/halflife-sdk/releases/download/v2.0/standardsdk.zip
39+
- http://metamod.org/files/sdk/old/standardsdk20.zip
40+
41+
### HLSDK 2.1:
42+
43+
- https://code.idtech.space/valve/halflife-sdk/releases/download/v2.1/standardsdk21.exe
44+
- http://metamod.org/files/sdk/old/standardsdk21.exe
45+
46+
### HLSDK 2.2 (Source code):
47+
48+
- https://code.idtech.space/valve/halflife-sdk/releases/download/v2.2/HL_Standard_SDK_2_2_Source.zip
49+
- http://metamod.org/files/sdk/old/HL_Standard_SDK_2_2_Source.zip
50+
51+
### HLSDK 2.2 (Full):
52+
53+
- https://code.idtech.space/valve/halflife-sdk/releases/download/v2.2/HL_Standard_SDK_2_2.exe
54+
- http://metamod.org/files/sdk/old/HL_Standard_SDK_2_2.exe

src/cl_dll/MOTD.cpp

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/***
2+
*
3+
* Copyright (c) 1999, Valve LLC. All rights reserved.
4+
*
5+
* This product contains software technology licensed from Id
6+
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7+
* All Rights Reserved.
8+
*
9+
* Use, distribution, and modification of this source code and/or resulting
10+
* object code is restricted to non-commercial enhancements to products from
11+
* Valve LLC. All other use, distribution, or modification is prohibited
12+
* without written permission from Valve LLC.
13+
*
14+
****/
15+
//
16+
// MOTD.cpp
17+
//
18+
// for displaying a server-sent message of the day
19+
//
20+
21+
#include "hud.h"
22+
#include "util.h"
23+
#include "parsemsg.h"
24+
25+
#include <string.h>
26+
#include <stdio.h>
27+
28+
DECLARE_MESSAGE( m_MOTD, MOTD );
29+
30+
int CHudMOTD::MOTD_DISPLAY_TIME;
31+
32+
int CHudMOTD :: Init( void )
33+
{
34+
gHUD.AddHudElem( this );
35+
36+
HOOK_MESSAGE( MOTD );
37+
38+
CVAR_CREATE( "motd_display_time", "6", 0 );
39+
40+
m_iFlags &= ~HUD_ACTIVE; // start out inactive
41+
m_szMOTD[0] = 0;
42+
43+
return 1;
44+
}
45+
46+
int CHudMOTD :: VidInit( void )
47+
{
48+
// Load sprites here
49+
50+
return 1;
51+
}
52+
53+
void CHudMOTD :: Reset( void )
54+
{
55+
m_iFlags &= ~HUD_ACTIVE; // start out inactive
56+
m_szMOTD[0] = 0;
57+
m_iLines = 0;
58+
m_flActiveTill = 0;
59+
}
60+
61+
#define LINE_HEIGHT 13
62+
63+
int CHudMOTD :: Draw( float fTime )
64+
{
65+
// Draw MOTD line-by-line
66+
67+
if ( m_flActiveTill < gHUD.m_flTime )
68+
{ // finished with MOTD, disable it
69+
m_szMOTD[0] = 0;
70+
m_iLines = 0;
71+
m_iFlags &= ~HUD_ACTIVE;
72+
return 1;
73+
}
74+
75+
// cap activetill time to the display time
76+
m_flActiveTill = min( gHUD.m_flTime + MOTD_DISPLAY_TIME, m_flActiveTill );
77+
78+
// find the top of where the MOTD should be drawn, so the whole thing is centered in the screen
79+
int ypos = max(((ScreenHeight - (m_iLines * LINE_HEIGHT)) / 2) - 40, 30 ); // shift it up slightly
80+
char *ch = m_szMOTD;
81+
while ( *ch )
82+
{
83+
int line_length = 0; // count the length of the current line
84+
for ( char *next_line = ch; *next_line != '\n' && *next_line != 0; next_line++ )
85+
line_length += gHUD.m_scrinfo.charWidths[ *next_line ];
86+
char *top = next_line;
87+
if ( *top == '\n' )
88+
*top = 0;
89+
else
90+
top = NULL;
91+
92+
// find where to start drawing the line
93+
int xpos = (ScreenWidth - line_length) / 2;
94+
95+
gHUD.DrawHudString( xpos, ypos, ScreenWidth, ch, 255, 180, 0 );
96+
97+
ypos += LINE_HEIGHT;
98+
99+
if ( top ) // restore
100+
*top = '\n';
101+
ch = next_line;
102+
if ( *ch == '\n' )
103+
ch++;
104+
105+
if ( ypos > (ScreenHeight - 20) )
106+
break; // don't let it draw too low
107+
}
108+
109+
return 1;
110+
}
111+
112+
int CHudMOTD :: MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf )
113+
{
114+
if ( m_iFlags & HUD_ACTIVE )
115+
{
116+
Reset(); // clear the current MOTD in prep for this one
117+
}
118+
119+
BEGIN_READ( pbuf, iSize );
120+
121+
int is_finished = READ_BYTE();
122+
strcat( m_szMOTD, READ_STRING() );
123+
124+
if ( is_finished )
125+
{
126+
m_iFlags |= HUD_ACTIVE;
127+
128+
MOTD_DISPLAY_TIME = CVAR_GET_FLOAT( "motd_display_time" );
129+
130+
m_flActiveTill = gHUD.m_flTime + MOTD_DISPLAY_TIME;
131+
132+
for ( char *sz = m_szMOTD; *sz != 0; sz++ ) // count the number of lines in the MOTD
133+
{
134+
if ( *sz == '\n' )
135+
m_iLines++;
136+
}
137+
}
138+
139+
return 1;
140+
}
141+

0 commit comments

Comments
 (0)