Fix preset lightstyles for Q3BSP, added examples to test_lightstyles.

This commit is contained in:
Marco Cawthorne 2020-10-18 15:19:56 +02:00
parent 2afba74a86
commit 6038c04591
7 changed files with 129 additions and 44 deletions

View File

@ -4,57 +4,57 @@
"classname" "worldspawn"
// brush 0
{
( 248 192 -64 ) ( 248 -192 -64 ) ( -264 192 -64 ) next/cracked1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 256 192 8 ) ( -256 192 8 ) ( 256 192 0 ) next/cracked1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 256 192 8 ) ( 256 192 0 ) ( 256 -192 8 ) next/cracked1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 -128 ) ( 256 -192 -128 ) ( -256 192 -128 ) next/cracked1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( -256 -192 0 ) ( -256 -192 8 ) ( 256 -192 0 ) next/cracked1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 0 ) ( -256 192 0 ) ( -256 -192 8 ) next/cracked1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 248 192 -64 ) ( 248 -192 -64 ) ( -264 192 -64 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 256 192 8 ) ( -256 192 8 ) ( 256 192 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 256 192 8 ) ( 256 192 0 ) ( 256 -192 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 -128 ) ( 256 -192 -128 ) ( -256 192 -128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( -256 -192 0 ) ( -256 -192 8 ) ( 256 -192 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 0 ) ( -256 192 0 ) ( -256 -192 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
// brush 1
{
( 248 192 192 ) ( 248 -192 192 ) ( -264 192 192 ) next/bunker1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 256 192 264 ) ( -256 192 264 ) ( 256 192 256 ) next/bunker1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 256 192 264 ) ( 256 192 256 ) ( 256 -192 264 ) next/bunker1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 128 ) ( 256 -192 128 ) ( -256 192 128 ) next/bunker1 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( -256 -192 256 ) ( -256 -192 264 ) ( 256 -192 256 ) next/bunker1 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 256 ) ( -256 192 256 ) ( -256 -192 264 ) next/bunker1 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 248 192 192 ) ( 248 -192 192 ) ( -264 192 192 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 256 192 264 ) ( -256 192 264 ) ( 256 192 256 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 256 192 264 ) ( 256 192 256 ) ( 256 -192 264 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 128 ) ( 256 -192 128 ) ( -256 192 128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( -256 -192 256 ) ( -256 -192 264 ) ( 256 -192 256 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 -192 256 ) ( -256 192 256 ) ( -256 -192 264 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
// brush 2
{
( 184 192 192 ) ( 184 -192 192 ) ( -328 192 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 192 192 264 ) ( -320 192 264 ) ( 192 192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 192 8 ) ( -256 192 0 ) ( -256 -192 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -768 -192 -128 ) ( -256 -192 -128 ) ( -768 192 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( -320 -192 256 ) ( -320 -192 264 ) ( 192 -192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -320 -192 256 ) ( -320 192 256 ) ( -320 -192 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 184 192 192 ) ( 184 -192 192 ) ( -328 192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 192 192 264 ) ( -320 192 264 ) ( 192 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -256 192 8 ) ( -256 192 0 ) ( -256 -192 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -768 -192 -128 ) ( -256 -192 -128 ) ( -768 192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( -320 -192 256 ) ( -320 -192 264 ) ( 192 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -320 -192 256 ) ( -320 192 256 ) ( -320 -192 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
// brush 3
{
( 760 192 192 ) ( 760 -192 192 ) ( 248 192 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 768 192 264 ) ( 256 192 264 ) ( 768 192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 320 192 8 ) ( 320 192 0 ) ( 320 -192 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -192 -192 -128 ) ( 320 -192 -128 ) ( -192 192 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 256 -192 256 ) ( 256 -192 264 ) ( 768 -192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 256 -192 256 ) ( 256 192 256 ) ( 256 -192 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 760 192 192 ) ( 760 -192 192 ) ( 248 192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 768 192 264 ) ( 256 192 264 ) ( 768 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 320 192 8 ) ( 320 192 0 ) ( 320 -192 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -192 -192 -128 ) ( 320 -192 -128 ) ( -192 192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 256 -192 256 ) ( 256 -192 264 ) ( 768 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 256 -192 256 ) ( 256 192 256 ) ( 256 -192 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
// brush 4
{
( 184 -192 192 ) ( 184 -576 192 ) ( -328 -192 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 192 -192 264 ) ( -320 -192 264 ) ( 192 -192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 320 96 8 ) ( 320 96 0 ) ( 320 -288 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -768 -576 -128 ) ( -256 -576 -128 ) ( -768 -192 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 272 -256 256 ) ( 272 -256 264 ) ( 784 -256 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -320 -576 256 ) ( -320 -192 256 ) ( -320 -576 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 184 -192 192 ) ( 184 -576 192 ) ( -328 -192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 192 -192 264 ) ( -320 -192 264 ) ( 192 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 320 96 8 ) ( 320 96 0 ) ( 320 -288 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -768 -576 -128 ) ( -256 -576 -128 ) ( -768 -192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 272 -256 256 ) ( 272 -256 264 ) ( 784 -256 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -320 -576 256 ) ( -320 -192 256 ) ( -320 -576 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
// brush 5
{
( 184 256 192 ) ( 184 -128 192 ) ( -328 256 192 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 192 256 264 ) ( -320 256 264 ) ( 192 256 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 320 544 8 ) ( 320 544 0 ) ( 320 160 8 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -768 -128 -128 ) ( -256 -128 -128 ) ( -768 256 -128 ) next/bunker2 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 272 192 256 ) ( 272 192 264 ) ( 784 192 256 ) next/bunker2 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -320 -128 256 ) ( -320 256 256 ) ( -320 -128 264 ) next/bunker2 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 184 256 192 ) ( 184 -128 192 ) ( -328 256 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 192 256 264 ) ( -320 256 264 ) ( 192 256 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 320 544 8 ) ( 320 544 0 ) ( 320 160 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -768 -128 -128 ) ( -256 -128 -128 ) ( -768 256 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 272 192 256 ) ( 272 192 264 ) ( 784 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( -320 -128 256 ) ( -320 256 256 ) ( -320 -128 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
}
// entity 1
@ -68,8 +68,82 @@
// entity 3
{
"classname" "light"
"origin" "192.000000 0.000000 64.000000"
"light" "100"
"origin" "192.000000 128.000000 64.000000"
"light" "50"
"pattern" "abmcfgyzmnhpazcf"
"targetname" "foobar"
"targetname" "foobar1"
"style" "12"
}
// entity 4
{
"classname" "light"
"origin" "192.000000 -128.000000 64.000000"
"light" "50"
"targetname" "foobar2"
"style" "2"
}
// entity 5
{
"classname" "func_button"
"target" "foobar2"
// brush 0
{
( 88 -40 0 ) ( 88 -80 0 ) ( 48 -40 0 ) next/rusty7 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 88 -48 72 ) ( 48 -48 72 ) ( 88 -48 64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 80 -40 72 ) ( 80 -40 64 ) ( 80 -80 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 48 -80 -64 ) ( 88 -80 -64 ) ( 48 -40 -64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 40 -80 64 ) ( 40 -80 72 ) ( 80 -80 64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 48 -80 64 ) ( 48 -40 64 ) ( 48 -80 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
}
// entity 6
{
"classname" "func_button"
"target" "foobar1"
// brush 0
{
( 88 152 0 ) ( 88 112 0 ) ( 48 152 0 ) next/rusty7 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 88 144 72 ) ( 48 144 72 ) ( 88 144 64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 80 152 72 ) ( 80 152 64 ) ( 80 112 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 48 112 -64 ) ( 88 112 -64 ) ( 48 152 -64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0
( 40 112 64 ) ( 40 112 72 ) ( 80 112 64 ) next/rusty7 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
( 48 112 64 ) ( 48 152 64 ) ( 48 112 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
}
}
// entity 7
{
"classname" "light"
"origin" "-192.000000 128.000000 64.000000"
"light" "25"
}
// entity 8
{
"classname" "light"
"origin" "-192.000000 -64.000000 64.000000"
"light" "25"
"style" "9"
}
// entity 9
{
"classname" "point_message"
"origin" "120.000000 128.000000 32.000000"
"message" "Custom pattern, toggable."
}
// entity 10
{
"classname" "point_message"
"origin" "120.000000 -64.000000 32.000000"
"message" "Preset pattern, toggable."
}
// entity 11
{
"classname" "point_message"
"origin" "-160.000000 -64.000000 32.000000"
"message" "Preset pattern, static."
}
// entity 12
{
"classname" "point_message"
"origin" "-160.000000 128.000000 32.000000"
"message" "No pattern, static."
}

View File

@ -341,6 +341,7 @@ CSQC_UpdateView(float w, float h, float focus)
Scores_Draw();
} else if (focus == TRUE) {
GameText_Draw();
PointMessage_Draw();
if (getplayerkeyvalue(player_localnum, "*spec") != "0") {
HUD_DrawSpectator();

View File

@ -88,7 +88,6 @@ void PointMessage_Draw(void)
vecPlayer = pSeat->m_vecPredictedOrigin;
#endif
#ifdef WASTES
string msg;
float distance;
for (entity eFind = world; (eFind = find(eFind, ::classname, "point_message"));) {
@ -101,9 +100,9 @@ void PointMessage_Draw(void)
}
if (PointMessage_Visible(m.origin, vecPlayer, getproperty(VF_ANGLES)) == TRUE) {
vector vTemp = project(m.origin) - [(stringwidth(msg, FALSE,[8,8]) / 2), 0];
Gfx_String(vTemp, msg, [8,8], autocvar_hud_color, 1.0f, FNT_GAME);
drawfont = FONT_CON;
vector vTemp = project(m.origin) - [(stringwidth(msg, FALSE,[12,12]) / 2), 0];
drawstring(vTemp, msg, [12,12], [1,1,1], 1.0f, 0);
}
}
#endif
}

View File

@ -375,6 +375,8 @@ func_button::SpawnKey(string strKey, string strValue)
void
func_button::func_button(void)
{
m_flWait = 4.0f;
CBaseTrigger::CBaseTrigger();
if (m_strSndPressed)

View File

@ -57,6 +57,7 @@ class light:CBaseTrigger
{
int m_iEnabled;
float m_flStyle;
float m_flSwitchStyle;
string m_strPattern;
void(void) light;
@ -103,6 +104,9 @@ light::SpawnKey(string strKey, string strValue)
case "pattern":
m_strPattern = strValue;
break;
case "switch_style":
m_flSwitchStyle = stof(strValue);
break;
case "style":
m_flStyle = stof(strValue);
style = __NULL__;
@ -116,6 +120,11 @@ void light::light(void)
{
m_strPattern = "m";
CBaseTrigger::CBaseTrigger();
/* switch styles before 12 are builtins from Quake. */
if (m_flSwitchStyle <= 11) {
m_strPattern = getlightstyle(m_flSwitchStyle);
}
}
CLASSEXPORT(light_spot, light)

View File

@ -261,7 +261,7 @@ void worldspawn(void)
lightstyle(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba");
lightstyle(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg");
lightstyle(4, "mamamamamama");
lightstyle(5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj");
lightstyle(5, "jklmnopqrstuvwxyzyxwvutsrqponmlkj");
lightstyle(6, "nmonqnmomnmomomno");
lightstyle(7, "mmmaaaabcdefgmmmmaaaammmaamm");
lightstyle(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa");