mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
start working on gui stuff for the new client menus and make the header file
protection macros consistent
This commit is contained in:
parent
45a1ef2140
commit
045e52cf14
21 changed files with 193 additions and 47 deletions
|
@ -1,5 +1,5 @@
|
|||
#ifndef __crudefile_h
|
||||
#define __crudefile_h
|
||||
#ifndef __ruamoko_crudefile_h
|
||||
#define __ruamoko_crudefile_h
|
||||
|
||||
@extern float (string path, string mode) cfopen;
|
||||
@extern void (float desc) cfclose;
|
||||
|
@ -8,4 +8,4 @@
|
|||
@extern float (float desc) cfeof;
|
||||
@extern float () cfquota;
|
||||
|
||||
#endif//__crudefile_h
|
||||
#endif//__ruamoko_crudefile_h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __debug_h
|
||||
#define __debug_h
|
||||
#ifndef __ruamoko_debug_h
|
||||
#define __ruamoko_debug_h
|
||||
|
||||
//FIXME@extern void () break;
|
||||
@extern void (string e) error;
|
||||
|
@ -10,4 +10,4 @@
|
|||
@extern void () traceoff;
|
||||
@extern void (entity e) eprint;
|
||||
|
||||
#endif//__debug_h
|
||||
#endif//__ruamoko_debug_h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __rua_entity_h
|
||||
#define __rua_entity_h
|
||||
#ifndef __ruamoko_entity_h
|
||||
#define __ruamoko_entity_h
|
||||
|
||||
#include "object.h"
|
||||
|
||||
|
@ -27,4 +27,4 @@
|
|||
@extern void (entity e) makestatic;
|
||||
@extern void (entity e) setspawnparms;
|
||||
|
||||
#endif//__rua_entity_h
|
||||
#endif//__ruamoko_entity_h
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef __infokey_h
|
||||
#define __infokey_h
|
||||
#ifndef __ruamoko_infokey_h
|
||||
#define __ruamoko_infokey_h
|
||||
|
||||
@extern string (entity e, string key) infokey;
|
||||
@extern void (entity ent, string key, string value) setinfokey;
|
||||
|
||||
#endif//__infokey_h
|
||||
#endif//__ruamoko_infokey_h
|
||||
|
|
33
ruamoko/include/inputline.h
Normal file
33
ruamoko/include/inputline.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#ifndef __ruamoko_inputline_h
|
||||
#define __ruamoko_inputline_h
|
||||
|
||||
#include "point.h"
|
||||
|
||||
struct _inputline_t = {}; // opaque type :)
|
||||
typedef _inputline_t [] inputline_t;
|
||||
|
||||
@extern inputline_t (integer lines, integer size, integer prompt) InputLine_Create;
|
||||
@extern void (inputline_t il, void [] data) InputLine_SetUserData;
|
||||
@extern void (inputline_t il, integer width) InputLine_SetWidth;
|
||||
@extern void (inputline_t il) InputLine_Destroy;
|
||||
@extern void (inputline_t il) InputLine_Clear;
|
||||
@extern void (inputline_t il, integer ch) InputLine_Process;
|
||||
@extern void (inputline_t il, integer cursor) InputLine_Draw;
|
||||
@extern void (inputline_t il, string str) InputLine_SetText;
|
||||
@extern string (inputline_t il) InputLine_GetText;
|
||||
|
||||
@interface InputLine : Object
|
||||
{
|
||||
Point at;
|
||||
inputline_t il;
|
||||
}
|
||||
-free;
|
||||
-initAt:(Point)p Lines:(integer)l Size:(integer)s Prompt:(integer)prompt;
|
||||
-setWidth:(integer)width;
|
||||
-process:(integer)key;
|
||||
-draw:(BOOL)cursor;
|
||||
-setText:(string)text;
|
||||
-(string)getText;
|
||||
@end
|
||||
|
||||
#endif//__ruamoko_inputline_h
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __math_h
|
||||
#define __math_h
|
||||
#ifndef __ruamoko_math_h
|
||||
#define __ruamoko_math_h
|
||||
|
||||
@extern vector v_forward, v_up, v_right;
|
||||
|
||||
|
@ -16,4 +16,4 @@
|
|||
@extern float (float f) fabs;
|
||||
@extern vector (vector v) vectoangles;
|
||||
|
||||
#endif//__math_h
|
||||
#endif//__ruamoko_math_h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __message_h
|
||||
#define __message_h
|
||||
#ifndef __ruamoko_message_h
|
||||
#define __ruamoko_message_h
|
||||
|
||||
// protocol bytes
|
||||
#define SVC_TEMPENTITY 23
|
||||
|
@ -45,4 +45,4 @@
|
|||
@extern void (float to, entity s) WriteEntity;
|
||||
@extern void (...) centerprint;
|
||||
|
||||
#endif//__message_h
|
||||
#endif//__ruamoko_message_h
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __nq_message_h
|
||||
#define __nq_message_h
|
||||
#ifndef __ruamoko_nq_message_h
|
||||
#define __ruamoko_nq_message_h
|
||||
|
||||
@extern void (vector o, vector d, float color, float count) particle;
|
||||
|
||||
#endif//__nq_message_h
|
||||
#endif//__ruamoko_nq_message_h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __rua_object_h
|
||||
#define __rua_object_h
|
||||
#ifndef __ruamoko_object_h
|
||||
#define __ruamoko_object_h
|
||||
|
||||
typedef enum {
|
||||
NO,
|
||||
|
@ -134,4 +134,4 @@ typedef enum {
|
|||
//-awake;
|
||||
@end
|
||||
|
||||
#endif//__rua_object_h
|
||||
#endif//__ruamoko_object_h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __physics_h
|
||||
#define __physics_h
|
||||
#ifndef __ruamoko_physics_h
|
||||
#define __ruamoko_physics_h
|
||||
|
||||
@extern float trace_allsolid;
|
||||
@extern float trace_startsolid;
|
||||
|
@ -27,4 +27,4 @@
|
|||
@extern void (integer hull) freeboxhull;
|
||||
@extern void (integer hull, vector right, vector forward, vector up, vector mins, vector maxs) rotate_bbox;
|
||||
|
||||
#endif//__physics_h
|
||||
#endif//__ruamoko_physics_h
|
||||
|
|
17
ruamoko/include/point.h
Normal file
17
ruamoko/include/point.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
#ifndef __ruamoko_point_h
|
||||
#define __ruamoko_point_h
|
||||
|
||||
#include "object.h"
|
||||
|
||||
@interface Point : Object
|
||||
{
|
||||
@public
|
||||
integer x,y;
|
||||
}
|
||||
-initAtX:(integer)_x Y:(integer)_y;
|
||||
-initWithPoint:(Point)p;
|
||||
-setTo:(Point)p;
|
||||
-moveBy:(Point)p;
|
||||
@end
|
||||
|
||||
#endif//__ruamoko_point_h
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef __qw_message_h
|
||||
#define __qw_message_h
|
||||
#ifndef __ruamoko_qw_message_h
|
||||
#define __ruamoko_qw_message_h
|
||||
|
||||
#include "message.h"
|
||||
|
||||
@extern void (vector where, float set) multicast;
|
||||
|
||||
#endif//__qw_message_h
|
||||
#endif//__ruamoko_qw_message_h
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef __qw_physics_h
|
||||
#define __qw_physics_h
|
||||
#ifndef __ruamoko_qw_physics_h
|
||||
#define __ruamoko_qw_physics_h
|
||||
|
||||
@extern entity (entity ent) testentitypos;
|
||||
@extern void (vector start, vector mins, vector maxs, vector end, float type, entity passent) checkmove;
|
||||
|
||||
#endif//__qw_physics_h
|
||||
#endif//__ruamoko_qw_physics_h
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __qw_sys_h
|
||||
#define __qw_sys_h
|
||||
#ifndef __ruamoko_qw_sys_h
|
||||
#define __ruamoko_qw_sys_h
|
||||
|
||||
@extern void (entity killer, entity killee) logfrag;
|
||||
|
||||
#endif//__qw_sys_h
|
||||
#endif//__ruamoko_qw_sys_h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __sound_h
|
||||
#define __sound_h
|
||||
#ifndef __ruamoko_sound_h
|
||||
#define __ruamoko_sound_h
|
||||
|
||||
#define CHAN_AUTO 0
|
||||
#define CHAN_WEAPON 1
|
||||
|
@ -16,4 +16,4 @@
|
|||
@extern void (entity e, float chan, string samp, float vol, float atten) sound;
|
||||
@extern void (vector pos, string samp, float vol, float atten) ambientsound;
|
||||
|
||||
#endif//__sound_h
|
||||
#endif//__ruamoko_sound_h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __string_h
|
||||
#define __string_h
|
||||
#ifndef __ruamoko_string_h
|
||||
#define __ruamoko_string_h
|
||||
|
||||
@extern void (entity client, string s) sprint;
|
||||
@extern string (float f) ftos;
|
||||
|
@ -12,4 +12,4 @@
|
|||
@extern integer (string s) stoi;
|
||||
@extern vector (string s) stov;
|
||||
|
||||
#endif//__string_h
|
||||
#endif//__ruamoko_string_h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __system_h
|
||||
#define __system_h
|
||||
#ifndef __ruamoko_system_h
|
||||
#define __ruamoko_system_h
|
||||
|
||||
@extern void (string s) precache_sound;
|
||||
@extern void (string s) precache_model;
|
||||
|
@ -15,4 +15,4 @@
|
|||
@extern float () checkextension;
|
||||
@extern string () gametype;
|
||||
|
||||
#endif//__system_h
|
||||
#endif//__ruamoko_system_h
|
||||
|
|
|
@ -8,7 +8,7 @@ RANLIB=touch
|
|||
|
||||
INCLUDES= -I$(top_srcdir)/ruamoko/include
|
||||
|
||||
noinst_LIBRARIES= libr.a
|
||||
noinst_LIBRARIES= libr.a libgui.a
|
||||
|
||||
%.qfo: %.r
|
||||
$(QFCC) $(QCFLAGS) $(QCPPFLAGS) -p $(STRIP) -c -o $@ $<
|
||||
|
@ -23,4 +23,8 @@ libr_a_SOURCES=\
|
|||
string.r system.r
|
||||
libr_a_AR=$(PAK) -cf
|
||||
|
||||
libgui_a_SOURCES=\
|
||||
inputline.r point.r
|
||||
libgui_a_AR=$(PAK) -cf
|
||||
|
||||
CLEANFILES = *.qfo
|
||||
|
|
|
@ -27,7 +27,7 @@ void (entity e) setspawnparms = #78;
|
|||
-free
|
||||
{
|
||||
remove (self.ent);
|
||||
return self;
|
||||
return [super free];
|
||||
}
|
||||
|
||||
-new
|
||||
|
|
59
ruamoko/lib/inputline.r
Normal file
59
ruamoko/lib/inputline.r
Normal file
|
@ -0,0 +1,59 @@
|
|||
#include "inputline.h"
|
||||
|
||||
inputline_t (integer lines, integer size, integer prompt) InputLine_Create = #0;
|
||||
void (inputline_t il, void [] data) InputLine_SetUserData = 0;
|
||||
void (inputline_t il, integer width) InputLine_SetWidth = #0;
|
||||
void (inputline_t il) InputLine_Destroy = #0;
|
||||
void (inputline_t il) InputLine_Clear = #0;
|
||||
void (inputline_t il, integer ch) InputLine_Process = #0;
|
||||
void (inputline_t il, integer cursor) InputLine_Draw = #0;
|
||||
void (inputline_t il, string str) InputLine_SetText = #0;
|
||||
string (inputline_t il) InputLine_GetText = #0;
|
||||
|
||||
@implementation InputLine
|
||||
|
||||
-free
|
||||
{
|
||||
[at free];
|
||||
InputLine_Destroy (il);
|
||||
return [super free];
|
||||
}
|
||||
|
||||
-initAt:(Point)p Lines:(integer)l Size:(integer)s Prompt:(integer)prompt
|
||||
{
|
||||
[super init];
|
||||
id(at) = [[Point alloc] initWithPoint:p];
|
||||
il = InputLine_Create (l, s, prompt);
|
||||
InputLine_SetUserData (il, at);
|
||||
return self;
|
||||
}
|
||||
|
||||
-setWidth:(integer)width
|
||||
{
|
||||
InputLine_SetWidth (il, width);
|
||||
return self;
|
||||
}
|
||||
|
||||
-process:(integer)key
|
||||
{
|
||||
InputLine_Process (il, key);
|
||||
return self;
|
||||
}
|
||||
|
||||
-draw:(BOOL)cursor
|
||||
{
|
||||
InputLine_Draw (il, cursor);
|
||||
}
|
||||
|
||||
-setText:(string)text
|
||||
{
|
||||
InputLine_SetText (il, text);
|
||||
return self;
|
||||
}
|
||||
|
||||
-(string)getText
|
||||
{
|
||||
return InputLine_GetText (il);
|
||||
}
|
||||
|
||||
@end
|
33
ruamoko/lib/point.r
Normal file
33
ruamoko/lib/point.r
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include "point.h"
|
||||
|
||||
@implementation Point
|
||||
|
||||
-initAtX:(integer)_x Y:(integer)_y
|
||||
{
|
||||
[super init];
|
||||
x = _x;
|
||||
y = _y;
|
||||
return self;
|
||||
}
|
||||
|
||||
-initWithPoint:(Point)p
|
||||
{
|
||||
[super init];
|
||||
x = p.x;
|
||||
y = p.y;
|
||||
return self;
|
||||
}
|
||||
|
||||
-setTo:(Point)p
|
||||
{
|
||||
x = p.x;
|
||||
y = p.y;
|
||||
return self;
|
||||
}
|
||||
|
||||
-moveBy:(Point)p
|
||||
{
|
||||
x += p.x;
|
||||
y += p.y;
|
||||
return self;
|
||||
}
|
Loading…
Reference in a new issue