code cleanup: use records where possible
This commit is contained in:
parent
f30141c8f3
commit
8e0bbd06c2
139 changed files with 957 additions and 1777 deletions
|
@ -1125,7 +1125,7 @@ public class Client implements IThreadListener {
|
|||
this.framecode(), this.framerate < 1.0f ? 1.0f / this.framerate : this.framerate, this.framerate < 1.0f ? "SPF" : "FPS",
|
||||
this.vsync ? TextColor.DGRAY + "VSYNC" : (this.syncLimited ? TextColor.GREEN + "" + this.syncLimit : TextColor.RED + "UNL"),
|
||||
(float)PerfSection.getTotal(false) / 1000.0f, this.fb_raw_x, this.fb_raw_y,
|
||||
this.fullscreen ? " @ " + (this.vidMode == null ? "?" : this.vidMode.refresh) + " Hz" : "",
|
||||
this.fullscreen ? " @ " + (this.vidMode == null ? "?" : this.vidMode.refresh()) + " Hz" : "",
|
||||
this.tpscode(), this.tickrate < 1.0f ? 1.0f / this.tickrate : this.tickrate,
|
||||
this.tickrate < 1.0f ? "SPT" : "TPS", (float)this.tickTarget / 1000.0f,
|
||||
(float)this.tick_time / 1000.0f, this.tickTimeout,
|
||||
|
@ -2089,40 +2089,40 @@ public class Client implements IThreadListener {
|
|||
|
||||
public void poll() {
|
||||
for(WindowEvent event : Window.poll()) {
|
||||
switch(event.action) {
|
||||
switch(event.action()) {
|
||||
case BUTTON:
|
||||
if(event.param1 >= 0 && event.param1 < Button.values().length)
|
||||
button(Button.values()[event.param1], event.param2 != 0);
|
||||
if(event.param1() >= 0 && event.param1() < Button.values().length)
|
||||
button(Button.values()[event.param1()], event.param2() != 0);
|
||||
break;
|
||||
case CHARACTER:
|
||||
if(event.param1 >= (int)Log.CHR_SPC && event.param1 <= (int)Character.MAX_VALUE)
|
||||
character((char)event.param1);
|
||||
if(event.param1() >= (int)Log.CHR_SPC && event.param1() <= (int)Character.MAX_VALUE)
|
||||
character((char)event.param1());
|
||||
break;
|
||||
case CLOSED:
|
||||
closed();
|
||||
break;
|
||||
case CURSOR:
|
||||
mouse(event.param1, event.param2);
|
||||
mouse(event.param1(), event.param2());
|
||||
break;
|
||||
case FOCUS:
|
||||
focus(event.param1 != 0);
|
||||
focus(event.param1() != 0);
|
||||
break;
|
||||
case KEY:
|
||||
if(event.param1 >= 0 && event.param1 < Keysym.values().length)
|
||||
key(Keysym.values()[event.param1], KeyEvent.values()[event.param2 % KeyEvent.values().length]);
|
||||
if(event.param1() >= 0 && event.param1() < Keysym.values().length)
|
||||
key(Keysym.values()[event.param1()], KeyEvent.values()[event.param2() % KeyEvent.values().length]);
|
||||
break;
|
||||
case POSITION:
|
||||
pos(event.param1, event.param2);
|
||||
pos(event.param1(), event.param2());
|
||||
break;
|
||||
case REDRAW:
|
||||
// redraw(); disable as it is pretty useless
|
||||
break;
|
||||
case RESIZE:
|
||||
fbsize(event.param1, event.param2);
|
||||
fbsize(event.param1(), event.param2());
|
||||
break;
|
||||
case SCROLL:
|
||||
if(event.param1 != 0 || event.param2 != 0)
|
||||
scroll(event.param1, event.param2);
|
||||
if(event.param1() != 0 || event.param2() != 0)
|
||||
scroll(event.param1(), event.param2());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2138,7 +2138,7 @@ public class Client implements IThreadListener {
|
|||
public void full(boolean full) {
|
||||
if((full != fullscreen || full) && (!full || vidMode != null)) {
|
||||
if(full) {
|
||||
Window.setFullscreen(vidMode.width, vidMode.height, vidMode.refresh);
|
||||
Window.setFullscreen(vidMode.width(), vidMode.height(), vidMode.refresh());
|
||||
}
|
||||
else {
|
||||
Window.setWindowed(saved_xpos, saved_ypos, xsize, ysize);
|
||||
|
@ -2156,7 +2156,7 @@ public class Client implements IThreadListener {
|
|||
}
|
||||
else {
|
||||
DisplayMode mode = Window.getDisplayMode();
|
||||
syncLimit = mode != null ? mode.refresh : 60;
|
||||
syncLimit = mode != null ? mode.refresh() : 60;
|
||||
}
|
||||
Window.setVSync(vsync);
|
||||
}
|
||||
|
@ -3113,13 +3113,13 @@ public class Client implements IThreadListener {
|
|||
y = up ? y - Font.YGLYPH : y;
|
||||
for(Iterator<Message> iter = log.iterator(); iter.hasNext();) {
|
||||
Message msg = iter.next();
|
||||
if((this.tmr_current - msg.time) <= fade || (log == this.chat && this.chatPermanent)) {
|
||||
if((this.tmr_current - msg.time()) <= fade || (log == this.chat && this.chatPermanent)) {
|
||||
if(align > 0)
|
||||
Drawing.drawTextbox(msg.message, x, y, bg);
|
||||
Drawing.drawTextbox(msg.message(), x, y, bg);
|
||||
else if(align < 0)
|
||||
Drawing.drawTextboxRight(msg.message, x, y, bg);
|
||||
Drawing.drawTextboxRight(msg.message(), x, y, bg);
|
||||
else
|
||||
Drawing.drawTextboxCentered(msg.message, x, y, bg);
|
||||
Drawing.drawTextboxCentered(msg.message(), x, y, bg);
|
||||
y += up ? -(Font.YGLYPH) : Font.YGLYPH;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue